GraphQOMB
GraphQOMB (Qompiler for Measurement-Based Quantum Computing, pronounced graphcomb) is a compiler framework for measurement-based quantum computation (MBQC). It keeps the resource-state structure, classical feedforward, and execution schedule as separate first-class objects, then lowers them to an executable measurement pattern with a Pauli frame.
This design makes GraphQOMB useful both as an executable MBQC compiler and as a foundation for fault-tolerant workflows. The same core pipeline can be used to build patterns, study schedule-dependent resource tradeoffs, simulate them with statevector or density-matrix backends, and export compatible patterns to Stim-oriented downstream tooling.
Core Workflow
GraphQOMB compiles MBQC patterns through three interfaces:
- Labelled graph state: the resource state, measurement bases, and I/O registration.
- Feedforward: correction maps together with detector/observable supports and detector tags, represented by
Feedforward. - Scheduler: preparation, entanglement, and measurement order for executable slices.
These are lowered with qompile(...) into a Pattern carrying:
- a command stream for scheduled MBQC execution,
- a
PauliFrame(orCliffordFramewhen needed) for classical dependency tracking, - metrics such as
max_space,depth, andactive_volume.
Features
- Explicit IR boundaries: work directly with graph-state, feedforward, and schedule objects instead of mixing them into a single representation.
- Pattern lowering: lower MBQC IRs to
TICK-delimited patterns with Pauli or conditional single-qubit Clifford feedforward. - Schedule analysis: compare depth-oriented and space-oriented schedules and inspect resulting resource metrics.
- Simulation: run circuit or pattern simulations with statevector and density-matrix backends.
- Stim export: export Pauli-only patterns for downstream FT analysis.
- Toolchain interoperability: use GraphQOMB downstream of circuit transpilation and graph-rewrite tooling such as PyZX and flow-finding utilities.
Installation
From PyPI
uv add graphqomb
Install optional PyZX integration:
uv add "graphqomb[pyzx]"
Install optional Stim integration:
uv add "graphqomb[stim]"
Install optional Clifft integration for noisy sampling with
non-Clifford inputs such as |T> and Clifford feedforward (Clifft requires Python 3.12 or later):
uv add "graphqomb[clifft]"
From Source
git clone https://github.com/UTokyo-FT-MBQC/graphqomb.git
cd graphqomb
uv sync
Install development dependencies:
uv sync --extra dev
Install documentation dependencies:
uv sync --extra doc
Quick Start
The quickest way to see the compiler pipeline is to start from an MBQC-native circuit, derive the graph/feedforward/schedule objects, and lower them into a pattern:
import numpy as np
from graphqomb.circuit import MBQCCircuit, circuit2graph
from graphqomb.qompiler import qompile
from graphqomb.simulator import PatternSimulator, SimulatorBackend
circuit = MBQCCircuit(3)
circuit.j(0, 0.5 * np.pi)
circuit.cz(0, 1)
circuit.cz(0, 2)
circuit.j(1, 0.75 * np.pi)
circuit.j(2, 0.25 * np.pi)
graphstate, xflow, scheduler = circuit2graph(circuit)
pattern = qompile(graphstate, xflow, scheduler=scheduler)
print("pattern depth:", pattern.depth)
print("pattern max space:", pattern.max_space)
simulator = PatternSimulator(pattern, SimulatorBackend.StateVector)
simulator.simulate()
print(simulator.state.state())
If you already have a graph-state design and explicit feedforward maps, you can skip circuit2graph(...) and call qompile(...) directly.
Documentation
- Getting started: https://graphqomb.readthedocs.io/en/latest/getting_started.html
- Architecture overview: https://graphqomb.readthedocs.io/en/latest/architecture.html
- Feedforward and parity compilation: Guide and API reference.
- Example gallery: https://graphqomb.readthedocs.io/en/latest/gallery/index.html
- API reference: Overview, patterns, correction frames.
- QEC graph-state builder reference: https://graphqomb.readthedocs.io/en/latest/qeccode.html
- Stim MPP import reference: https://graphqomb.readthedocs.io/en/latest/stim_glue/mpp.html
- Round-preserving syndrome extraction: Local MPP rewriting, preserving successive data chains and measurement instruments.
- Stim Clifford transpiler reference: https://graphqomb.readthedocs.io/en/latest/stim_glue/transpiler.html
- Stim circuit import reference: https://graphqomb.readthedocs.io/en/latest/stim_glue/importer.html
- Stim compiler reference: https://graphqomb.readthedocs.io/en/latest/stim_glue/compiler.html
Development
Running Tests
uv run pytest
uv run pytest tests/test_specific.py
Code Quality
uv run ruff check
uv run ruff format
uv run mypy
uv run pyright
Building Documentation
cd docs
uv run sphinx-build -W source build
Contributing
Contributions are welcome. Please open an issue or pull request with:
- A clear description of the change.
- Tests for behavioral changes when applicable.
- Documentation updates for user-facing features.
Related Projects
- graphix: MBQC software stack with a different abstraction strategy.
- PyZX: ZX-calculus tooling that can be used upstream of GraphQOMB.
- swiflow: Flow-finding utilities for MBQC dependency structures.
- Stim: Fast stabilizer-circuit simulator targeted by the Stim export path.
Our ongoing projects
- ls-pattern-compile: Lattice-surgery compiler for MBQC backends.
- graphqomb-studio: 2D&3D GUI editor and visualizer for
GraphQOMBpackage.
License
Citation
If you use GraphQOMB in your research, please cite:
@software{graphqomb,
title = {GraphQOMB: A Modular Graph State Qompiler for Measurement-Based Quantum Computation},
author = {Masato Fukushima, Sora Shiratani, Yuki Watanabe, and Daichi Sasaki},
year = {2025},
url = {https://github.com/UTokyo-FT-MBQC/graphqomb}
}
Acknowledgements
We acknowledge the NICT Quantum Camp for supporting our development.
Special thanks to Fixstars Amplify:
Metadata
Release files for graphqomb 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| graphqomb-0.7.0.tar.gz | 275.6 kB | With provenance | Details for graphqomb-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| graphqomb-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for graphqomb-0.7.0-py3-none-any.whl |
Total release size: 449.2 kB
Release files / graphqomb-0.7.0.tar.gz
| Download URL | graphqomb-0.7.0.tar.gz |
|---|---|
| Size | 275.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f8e48e6fd0ada365a79826f503b364d45d612b6a0eea19e96c5ac462ac043b9
|
|
BLAKE2b-256 checksum How to use checksums |
6ccb8b4f384ec75ae5d6c0f58279c47775764c7854885bd4de3a5264610b8d4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 4, 2026.
Transparency logRelease files / graphqomb-0.7.0-py3-none-any.whl
| Download URL | graphqomb-0.7.0-py3-none-any.whl |
|---|---|
| Size | 173.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99dc35cf312621634dfe3350f561ffa28a1176411f8f294fc38bf25bd490ecf3
|
|
BLAKE2b-256 checksum How to use checksums |
f3ff01b274b5a6816d7401ce3864a22e4ad070b825fe7e1ab4c1f6b423194ef1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 4, 2026.
Transparency logSecurity for graphqomb 0.7.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for graphqomb-0.7.0.tar.gz
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 Nov 4, 2026.
Transparency logA 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.