Home

Awesome

<img src="https://github.com/TeamGraphix/graphix/raw/master/docs/logo/black_with_name.png" alt="logo" width="550">

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

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

Installation

Install graphix with pip:

pip install graphix

Install together with device interface:

pip install graphix[extra]

this will install graphix and inteface for IBMQ and Perceval to run MBQC patterns on superconducting and optical QPUs and their simulators.

Using graphix

generating pattern from a circuit

from graphix import Circuit

circuit = Circuit(4)
circuit.h(0)
...
pattern = circuit.transpile().pattern
pattern.draw_graph()
<img src="https://github.com/TeamGraphix/graphix/assets/33350509/de17c663-f607-44e2-945b-835f4082a940" alt="graph_flow" width="750">

<small>note: this graph is generated from QAOA circuit, see our example code. 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. </small>

preprocessing Pauli measurements

pattern.perform_pauli_measurements()
pattern.draw_graph()
<img src="https://github.com/TeamGraphix/graphix/assets/33350509/3c30a4c9-f912-4a36-925f-2ff446a07c68" alt="graph_gflow" width="140">

<small>(here, the graph is visualized based on generalized flow.)</small>

simulating the pattern

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

and more..

Citing

Shinichi Sunami and Masato Fukushima, Graphix. (2023) https://doi.org/10.5281/zenodo.7861382

<!-- Update on the [arXiv paper](https://arxiv.org/pdf/2212.11975.pdf): [^1] [^1]: Following the release of this arXiv preprint, we were made aware of [Backens et al.](https://quantum-journal.org/papers/q-2021-03-25-421/) and related work, where graph-theoretic simplification (Pauli measurement elimination) of patterns were shown. Many thanks for letting us know about this work - at the time of the writing we were not aware of these important relevant works but will certainly properly mention in the new version; we are working on significant restructuring and rewriting of the paper and hope to update the paper soon. -->

Contributing

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

Discord Server

Please visit Unitary Fund's Discord server, where you can find a channel for graphix to ask questions.

Core Contributors

Dr. Shinichi Sunami (University of Oxford)

Masato Fukushima (University of Tokyo, Fixstars Amplify)

Acknowledgements

We are proud to be supported by unitary fund microgrant program.

<p><a href="https://unitary.fund/grants.html"> <img src="https://user-images.githubusercontent.com/33350509/233384863-654485cf-b7d0-449e-8868-265c6fea2ced.png" alt="unitary-fund" width="150"/> </a></p>

Special thanks to Fixstars Amplify:

<p><a href="https://amplify.fixstars.com/en/"> <img src="https://github.com/TeamGraphix/graphix/raw/master/docs/imgs/fam_logo.png" alt="amplify" width="200"/> </a></p>

License

Apache License 2.0