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.

  • 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 (alphabetical order)

  • Masato Fukushima (University of Tokyo, Fixstars Amplify)
  • Maxime Garnier (Inria Paris)
  • Thierry Martinez (Inria Paris)
  • Sora Shiratani (University of Tokyo, Fixstars Amplify)
  • Shinichi Sunami (University of Oxford)

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.3.1.tar.gz (161.0 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.1-py3-none-any.whl (110.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for graphix-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f74c36402569face9e3e2aa546703e7d8d887f50f539e8bc4a0817c544035671
MD5 90adcc4c79f137eb0a2bd78d5473bdaf
BLAKE2b-256 3655b754e53d235dbb853791f2f77cbde5700530b0390e79b3f02e440d1ff2c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphix-0.3.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for graphix-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5aa202e9ec2645225d25358ea6cc702e51a8892fbf2a2bf1dbb87c092ca23e56
MD5 c5f804e9218e54fcfd343c0f2a3167ba
BLAKE2b-256 e6edb8b36185fc935fc79845cdc6be6c428703fccb5c806114ca13071997cc18

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphix-0.3.1-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