Skip to main content

Optimize and simulate measurement-based quantum computation

Project description

logo

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

  • 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

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()
graph_flow

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.

preprocessing Pauli measurements

pattern.perform_pauli_measurements()
pattern.draw_graph()
graph_gflow

(here, the graph is visualized based on generalized flow.)

simulating the pattern

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

and more..

  • See demos showing other features of graphix.

  • You can try demos on browser with mybinder.org: Binder

  • Read the tutorial for more usage guides.

  • For theoretical background, read our quick introduction into MBQC and LC-MBQC.

  • Full API docs is here.

Citing

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

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.

unitary-fund

Special thanks to Fixstars Amplify:

amplify

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.2.16.tar.gz (154.2 kB view details)

Uploaded Source

Built Distribution

graphix-0.2.16-py3-none-any.whl (109.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: graphix-0.2.16.tar.gz
  • Upload date:
  • Size: 154.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for graphix-0.2.16.tar.gz
Algorithm Hash digest
SHA256 7e4806f79e76690a94c7da87ea5a89b556636c63e2ee497ca550c1ee5b900160
MD5 4ce4a6a4da8c3c8a77814f1b012c463e
BLAKE2b-256 df9157374a982cdd6b58918848f2a55580a01483c666a2d25c1d7b3796e605ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: graphix-0.2.16-py3-none-any.whl
  • Upload date:
  • Size: 109.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for graphix-0.2.16-py3-none-any.whl
Algorithm Hash digest
SHA256 55ae8cd1d54e55866c80e53afd409e2d3f43780597b4a0cc3eeaa6bb2480337c
MD5 0fbc623b9498fb0becafda8ff2190e01
BLAKE2b-256 b2a0c7c4145fca558603835ff026bc94772ae189deded7eae6f02ba51292e79b

See more details on using hashes here.

Supported by

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