Skip to main content

Optimize and simulate measurement-based quantum computation

Project description

logo

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

Graphix is a measurement-based quantum computing (MBQC) software package, featuring

  • the measurement calculus framework with integrated graphical rewrite rules for Pauli measurement preprocessing
  • circuit-to-pattern transpiler, graph-based deterministic pattern generator and manual pattern generation
  • flow, gflow and pauliflow finding tools and graph visualization based on flows (see below)
  • statevector, density matrix and tensornetwork pattern simulation backends
  • QPU interface and fusion network extraction tool
  • new: efficient implementation of fast O(N^3) pauli-flow finding algorithm

Installation

Install graphix with pip:

pip install graphix

Install together with extra packages:

pip install graphix[extra]

Using graphix

generating pattern from a circuit

from graphix import Circuit

circuit = Circuit(4)
circuit.h(0)
...
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 'l:n' below indicate the execution layers or the order in the graph (measurements should happen from left to right, and nodes in the same layer can be measured simultaneously), based on the partial order associated with the (maximally-delayed) flow.

preprocessing Pauli measurements (Clifford gates)

pattern.perform_pauli_measurements()
pattern.draw_graph()
graph_gflow

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

simulating the pattern

state_out = pattern.simulate_pattern(backend="statevector")

and more..

  • See demos showing other features of graphix.
  • Read the tutorial for more usage guides.
  • For theoretical background, read our quick introduction into MBQC and LC-MBQC.
  • Full API docs is here.

Related packages

Projects using graphix

  • veriphix: verified blind quantum computation and benchmarking.
  • optyx: ZX-based software for networked quantum computing.

Citing

Please cite as

@software{uldemolins2026grpahix034,
  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},
  month        = feb,
  year         = 2026,
  publisher    = {Zenodo},
  version      = {v0.3.4},
  doi          = {10.5281/zenodo.18503266},
  url          = {https://doi.org/10.5281/zenodo.18503266},
}
@misc{sunami2022graphix,
      title={Graphix: optimizing and simulating measurement-based quantum computation on local-Clifford decorated graph},
      author={Shinichi Sunami and Masato Fukushima},
      year={2022},
      eprint={2212.11975},
      archivePrefix={arXiv},
      primaryClass={quant-ph},
      url={https://arxiv.org/abs/2212.11975},
}

Contributing

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

Discussion channels

Maintainers (alphabetical order)

  • Masato Fukushima (University of Tokyo, Fixstars Amplify)
  • Maxime Garnier (Inria Paris)
  • Emlyn Graham (Inria Paris)
  • Thierry Martinez (Inria Paris)
  • Pranav Nair (Inria Paris)
  • Sora Shiratani (University of Tokyo, Fixstars Amplify)
  • Shinichi Sunami (University of Oxford)
  • Mateo Uldemolins (Inria Paris)

Acknowledgements

Graphix was founded in 2022 by Shinichi Sunami (University of Oxford) with assistance from Masato Fukushima (University of Tokyo, Fixstars Amplify), supported by Fixstars Amplify and Unitary Foundation, and later joined by Daichi Sasaki, Yuki Watanabe and Sora Shiratani (University of Tokyo, Fixstars Amplify).

Unitary Foundation logo Fixstars Amplify logo

Since 2023, Graphix team is joined by Qode group of the QAT team, co-hosted by Inria and ENS, who develops and maintains the library.

Inria logo   ENS PSL logo   QAT logo

Special thanks also to HQI.

HQI logo

License

Apache License 2.0

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

graphix-0.3.5.tar.gz (162.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphix-0.3.5-py3-none-any.whl (181.2 kB view details)

Uploaded Python 3

File details

Details for the file graphix-0.3.5.tar.gz.

File metadata

  • Download URL: graphix-0.3.5.tar.gz
  • Upload date:
  • Size: 162.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for graphix-0.3.5.tar.gz
Algorithm Hash digest
SHA256 8de9263266a37686530a7fbdab5cbd749ea11356ff6b4bbe56532a9ed76ebe66
MD5 e9cebaa6f1c480c27b8cc9cd3d598da5
BLAKE2b-256 89f76820c1cba556c5209e97d2935c38dfe16b0d63959494608b07dd46eef79b

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphix-0.3.5.tar.gz:

Publisher: release.yml on TeamGraphix/graphix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file graphix-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: graphix-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 181.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for graphix-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6bb51cb58e89a8117662a43874b29ceb36403537b09cbf71c40ad799bd907801
MD5 7acb20e2bb10efdc672fa769f4b58ca5
BLAKE2b-256 89ee3cc0e9212f29a74c7b543c489e28ed3b4b5f9631b8c38c128e2ead5c64ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphix-0.3.5-py3-none-any.whl:

Publisher: release.yml on TeamGraphix/graphix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page