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 interface 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.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.

Projects using graphix

  • Verphix: verified blind quantum computation and benchmarking.

Citing

Shinichi Sunami and Masato Fukushima, Graphix. (2023)

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.2.tar.gz (116.8 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.2-py3-none-any.whl (130.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: graphix-0.3.2.tar.gz
  • Upload date:
  • Size: 116.8 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.2.tar.gz
Algorithm Hash digest
SHA256 86c9c981ff58043f8aec4e9a5449c11accd1319911244bf99467d742add81cd9
MD5 1eaf47fdb9968b53528b9fb9b243b5b3
BLAKE2b-256 57add71e21e906202dfb70e4c5116bbb3ca52247e5dac6d9392e9b6b85c8ae1a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: graphix-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 130.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 486d7414ccf2f2f6458f8554453af8a58e76bbb3a72de118693dfdbc12752d15
MD5 2307a5fd056fd196236212b5f86e3888
BLAKE2b-256 74f8a713a1964d42e7d0af897f11c842a64fba3f27db6a4fb8150f268911ddda

See more details on using hashes here.

Provenance

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