Skip to main content

Qiskit LEAN Verify Game

Open In Colab

Circuit puzzles built on the Qiskit SDK, with level content shared with the CliffordGame lean4game submission. This package is the Qiskit-Ecosystem-eligible half of that project — it interfaces with qiskit.QuantumCircuit and qiskit.quantum_info.Statevector directly, which the lean4game version (pure Lean, no Python) structurally cannot do.

Read docs/LIMITATIONS.md before writing any external-facing copy about this package — in particular, what "cross-checked" precisely does and does not claim.

Install

pip install -e ".[widget,test]"

Use

from qiskit_lean_verify_game.levels import get_level, build_circuit
from qiskit_lean_verify_game.grader import grade_circuit

level = get_level("level07_bell_state")
circuit = build_circuit(level, [("H", 0), ("CNOT", 0, 1)])
result = grade_circuit(circuit, level.target)
print(result.passed, result.reason)

In a notebook, for the interactive gate-button widget on a single level:

from qiskit_lean_verify_game.widget import LevelWidget
from qiskit_lean_verify_game.levels import get_level

LevelWidget(get_level("level07_bell_state")).show()

Or for the full click-through-all-levels experience — a row of level buttons (checkmarked as you solve them) plus the active level's gate buttons:

from qiskit_lean_verify_game.widget import GameShell

GameShell().show()

Structure

  • Colab/Qiskit_LEAN_Verify_Game.ipynb — runnable demo notebook (installs the package from this repo, plays through all 7 levels via GameShell). Open directly in Colab via the badge above.
  • grader.py — decidable circuit-vs-target checker (Statevector-based, no notebook or Lean dependency).
  • levels.py — level content, ported from CliffordGame's v1 roadmap (Clifford-world levels 1-7; level 8 / ZX spider fusion deliberately not ported — see docs/LIMITATIONS.md).
  • widget.py — Jupyter UI: LevelWidget (single level, gate buttons + live grading) and GameShell (level-select buttons on top, tracks solved state, swaps the active LevelWidget). Same clear_output() + redraw pattern as qiskit-sqd-dashboard.
  • data/verified_equivalences.json + scripts/crosscheck_against_lean.py
    • scripts/lean_reference/ — the cross-check machinery against CliffordGame's Lean proofs. Functional as of this update: run python scripts/crosscheck_against_lean.py (requires a Lean 4 toolchain on PATH) to independently verify this package's grader against CliffordGame's actual proofs.

Status

27/27 tests passing (pytest tests/), including end-to-end tests that click real ipywidgets buttons rather than only testing the grading logic those buttons call. Cross-checked against CliffordGame's actual Lean proofs via scripts/crosscheck_against_lean.py — all 7 levels pass (requires a local Lean toolchain to rerun; not part of the pytest suite since it needs Lean installed, which CI for this package doesn't assume).

Metadata

Release files for qiskit-lean-verify-game 0.1.1

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

Source distribution (sdist)

Source distribution for qiskit-lean-verify-game 0.1.1
File Size Uploaded Provenance Actions
qiskit_lean_verify_game-0.1.1.tar.gz 14.5 kB Without provenance Details for qiskit_lean_verify_game-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qiskit-lean-verify-game 0.1.1
File Interpreter ABI Platform Actions
qiskit_lean_verify_game-0.1.1-py3-none-any.whl Python 3 none any Details for qiskit_lean_verify_game-0.1.1-py3-none-any.whl

Total release size: 28.0 kB

Release files / qiskit_lean_verify_game-0.1.1.tar.gz

Download URL qiskit_lean_verify_game-0.1.1.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3e74c2955c72e410d5067c022f6d5cc41fbd4bef4d8918e1f74df5dde01a41b6
BLAKE2b-256 checksum
How to use checksums
afbc2e32753a5dff3fc9e956e78f699c3657026ec9833af39b0b82a628f4d334
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / qiskit_lean_verify_game-0.1.1-py3-none-any.whl

Download URL qiskit_lean_verify_game-0.1.1-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a26722af8ffeae2a174e5495d2fd4a01d3621c7cfd3792523285562ec73f3283
BLAKE2b-256 checksum
How to use checksums
9a293f998fa8cec47e780485a0725aa18568c7b234459c2696d173e20fcc68f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Security for qiskit-lean-verify-game 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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