A modular Graph State qompiler for measurement-based quantum computing.
Project description
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 is organized around three explicit compiler interfaces:
- Labelled graph state: the resource state, measurement bases, and I/O registration.
- Feedforward maps: explicit
xflowand optionalzflowdescribing classical dependencies. - 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
PauliFramefor 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: compile MBQC IRs into executable patterns with
TICK-delimited slices and Pauli-frame tracking. - 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: compile compatible patterns to Stim text for downstream FT-oriented analysis.
- Toolchain interoperability: use GraphQOMB downstream of circuit transpilation and graph-rewrite tooling such as PyZX and flow-finding utilities.
Installation
From PyPI
pip install graphqomb
Install optional PyZX integration:
pip install "graphqomb[pyzx]"
From Source
git clone https://github.com/TeamGraphix/graphqomb.git
cd graphqomb
pip install -e .
Install development dependencies:
pip install -e .[dev]
Install documentation dependencies:
pip install -e .[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
- Example gallery: https://graphqomb.readthedocs.io/en/latest/gallery/index.html
- API reference: https://graphqomb.readthedocs.io/en/latest/references.html
- Stim compiler reference: https://graphqomb.readthedocs.io/en/latest/stim_compiler.html
Current Scope
GraphQOMB currently targets static, branch-free MBQC workflows. It is designed around causal feedforward dependencies and explicit scheduling, which makes it a good fit for pattern generation, simulation, and offline analysis of executable or fault-tolerant MBQC pipelines.
Development
Running Tests
pytest
pytest tests/test_specific.py
Code Quality
ruff check
ruff format
mypy
pyright
Building Documentation
cd docs
make html
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/TeamGraphix/graphqomb}
}
Acknowledgements
We acknowledge the NICT Quantum Camp for supporting our development.
Special thanks to Fixstars Amplify:
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
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 graphqomb-0.3.0.tar.gz.
File metadata
- Download URL: graphqomb-0.3.0.tar.gz
- Upload date:
- Size: 112.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4809c4c0532be470b92b993eed2856d2a07e05ea4d5602cad08dcaf7119d0fbb
|
|
| MD5 |
2b2cf4668da082a1472ad570866a527f
|
|
| BLAKE2b-256 |
84a146285532ff2a9b1f2d0a1eb12211a1fc7ea7885c76d70daee58212c3a904
|
Provenance
The following attestation bundles were made for graphqomb-0.3.0.tar.gz:
Publisher:
publish-to-pypi.yml on TeamGraphix/graphqomb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graphqomb-0.3.0.tar.gz -
Subject digest:
4809c4c0532be470b92b993eed2856d2a07e05ea4d5602cad08dcaf7119d0fbb - Sigstore transparency entry: 1251652721
- Sigstore integration time:
-
Permalink:
TeamGraphix/graphqomb@eaa6f69b35b0b8b5043375bb4659082444a2d4e1 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/TeamGraphix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@eaa6f69b35b0b8b5043375bb4659082444a2d4e1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file graphqomb-0.3.0-py3-none-any.whl.
File metadata
- Download URL: graphqomb-0.3.0-py3-none-any.whl
- Upload date:
- Size: 77.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7280a7daf3229727e63bbf95b7a0d0cc7281186d615a99e8d8e569970cf5b16b
|
|
| MD5 |
6fe686d549704edb2afe1780ba0a278d
|
|
| BLAKE2b-256 |
9e67c5ed41a4d89fd54d9038c2d39e6f803b1c18b218be44ba3875276c5cb084
|
Provenance
The following attestation bundles were made for graphqomb-0.3.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on TeamGraphix/graphqomb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graphqomb-0.3.0-py3-none-any.whl -
Subject digest:
7280a7daf3229727e63bbf95b7a0d0cc7281186d615a99e8d8e569970cf5b16b - Sigstore transparency entry: 1251652734
- Sigstore integration time:
-
Permalink:
TeamGraphix/graphqomb@eaa6f69b35b0b8b5043375bb4659082444a2d4e1 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/TeamGraphix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@eaa6f69b35b0b8b5043375bb4659082444a2d4e1 -
Trigger Event:
push
-
Statement type: