Skip to main content

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.

Metadata

Release files for cleitonforge 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cleitonforge 0.4.0
File Size Uploaded
cleitonforge-0.4.0.tar.gz 95.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for cleitonforge 0.4.0
File Interpreter ABI Platform
cleitonforge-0.4.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
cleitonforge-0.4.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
cleitonforge-0.4.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.8 abi3 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details

Total release size: 5.1 MB

Release files / cleitonforge-0.4.0.tar.gz

Download URL cleitonforge-0.4.0.tar.gz
Size 95.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3ad3a1157804a9b427c31ed24248349265273f9aa832809ef6604e8146d7e321
BLAKE2b-256 checksum
How to use checksums
f1174d65f259c205c0affbcc109a5cc5d169a5811b66857774cc26595aa50280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / cleitonforge-0.4.0-cp38-abi3-win_amd64.whl

Download URL cleitonforge-0.4.0-cp38-abi3-win_amd64.whl
Size 1.0 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8a83c046d6c971357e2d157857cb2f00be5218ac4cf2d905ec296e911c600262
BLAKE2b-256 checksum
How to use checksums
bacfcfd91edb0d31977ebc81543540631726e3b1af5478409bd23211fe00edcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / cleitonforge-0.4.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL cleitonforge-0.4.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.9 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
28fb547417fa7ad4712cb9b96c4f304324246ef612b6c3d97ebbc175114e11aa
BLAKE2b-256 checksum
How to use checksums
3d2ea6f8f85929d2c4c1a8bab0f3f662ceecd074ad4cba9ba07bd8fd7826c2aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release files / cleitonforge-0.4.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL cleitonforge-0.4.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.0 MB
Tags CPython 3.8 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
45f03003313d2833a566fe46266134f068adfca05bbac6fc74ecc6f7831b9ea9
BLAKE2b-256 checksum
How to use checksums
1589a4430873151aa5661e9c7ff4601e77a95b1764b061dc4bf085718f25b3a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

4 release files

0.1.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page