Skip to content
TeamGraphixPublic

About

measurement-based quantum computing (MBQC) library

Topics

Resources

Code of conduct

Contributing

Stars

119 stars

Watchers

3 watching

Forks

Repository files navigation

Graphix logo

PyPI License PyPI - Python Version Downloads Unitary Foundation DOI CI codecov Documentation Status Ruff

Graphix is an open-source Python library for building, optimizing, and simulating measurement-based quantum computations (MBQC). It features:

  • The measurement calculus framework with integrated graphical rewrite rules for pre-processing Pauli measurements.
  • Circuit-to-pattern transpiler, automatic pattern generation from graph states and manual pattern generation.
  • State-of-the-art causal flow, gflow and Pauli flow finding algorithms and visualization tools.
  • Statevector and density matrix simulation backends.
  • Circuit extraction.
  • Parametric MBQC computations.
  • Export to OpenQASM for external simulation and QPU integration.
  • An extensible plugin ecosystem.

For usage examples drawn from recent research on MBQC and further details on the architecture, design and algorithm implementations, check our latest preprint!

Full documentation, including detailed Graphix tutorials and an introduction to measurement-based quantum computation (MBQC), is available at graphix.readthedocs.io.

Installation

Install graphix with pip:

pip install graphix

Editable installation using pip and uv

As well as support for editable installation using pip, Graphix also supports using uv:

git clone https://github.com/TeamGraphix/graphix.git
cd graphix
uv sync --extra dev

This creates a virtual environment and installs all development dependencies from the pyproject.toml and uv lockfile.

Using Graphix

Generating a pattern from a circuit

from graphix import Circuit

circuit = Circuit(4)
...
pattern = circuit.transpile().pattern
pattern.standardize()
pattern.shift_signals()

pattern.draw_graph(flow_from_pattern=False)

graph_flow

See our example code to generate this pattern. Arrows indicate the causal flow of MBQC and dashed lines are the other edges of the graph. The vertical dashed partitions and the labels below indicate the execution layers based on the partial order associated with the (maximally-delayed) flow of the graph. Measurements happen from left to right, and nodes in the same layer can be measured simultaneously.

Pre-processing Pauli measurements (Clifford gates)

pattern.infer_pauli_measurements()
pattern.remove_pauli_measurements()

pattern.draw(flow_from_pattern=False)

graph_gflow

(here, the visualization is based on generalized flow).

Simulating the pattern

state_out = pattern.simulate()

And more...

Check graphix.readthedocs.io !

Graphix plugins

Projects using Graphix

  • veriphix: verified blind quantum computation and benchmarking.
  • optyx: ZX-based software for networked quantum computing.
  • QPatLib: a community repository for MBQC patterns and supporting tooling.

Citing

If you use Graphix in your research, please consider citing the associated papers and the accompanying software release.

Papers

@article{uldemolins2026_graphix,
  title={Graphix: A software framework for Measurement-Based Quantum Computation},
  author={Uldemolins, Mateo and Nair, Pranav and Graham, Emlyn and Sunami, Shinichi and Martinez, Thierry and Garnier, Maxime},
  journal={arXiv preprint arXiv:2608.24781},
  year={2026}
}
@article{sunami2022_graphix,
  title={Graphix: Optimizing and simulating measurement-based quantum computation on local-Clifford decorated graph},
  author={Sunami, Shinichi and Fukushima, Masato},
  journal={arXiv preprint arXiv:2212.11975},
  year={2022}
}

Software

@software{graphix_v04,
  author    = {Uldemolins, Mateo and Fukushima, Masato and
              Graham, Emlyn and Nair, Pranav and Sasaki, Daichi and
              Shiratani, Sora and Watanabe, Yuki and
              Martinez, Thierry and Garnier, Maxime and Sunami, Shinichi},
  title     = {Graphix},
  version   = {0.4},
  year      = {2026},
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.21997813},
}

Contributing

We use GitHub issues for tracking feature requests and bug reports.

Discussion channels

Current maintainers (alphabetical order)

Acknowledgements

Graphix was started in 2022 by Shinichi Sunami (University of Oxford) and Masato Fukushima (University of Tokyo, Fixstars Amplify). Daichi Sasaki, Yuki Watanabe, and Sora Shiratani (University of Tokyo, Fixstars Amplify) later joined the team.

In 2023, the QAT team joined the effort and now maintains the library. We thank Emlyn Graham (Inria Paris) for his contributions to Graphix from 2025 to 2026.

The project has been supported by Fixstars Amplify and the Unitary Foundation, and currently participates in the French Hybrid Quantum Initiative.

Unitary Foundation logo Fixstars Amplify logo

Inria logo   ENS PSL logo   QAT logo

HQI logo

License

Apache License 2.0

About

measurement-based quantum computing (MBQC) library

Topics

Resources

Code of conduct

Contributing

Stars

119 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages