Code Monkey home page Code Monkey logo

graphix's Introduction

logo

PyPI - Python Version PyPI Unitary Fund DOI Documentation Status GitHub Downloads Code style: black

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- and gflow-based graph visualization tools
  • 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.draw_graph()
logo

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

(here, the graph has 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 bugs 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

graphix's People

Contributors

shinich1 avatar masato-fuk avatar d1ssk avatar king-p3nguin avatar earlmilktea avatar thierry-martinez avatar nabe98 avatar gopal-dahale avatar masa10-f avatar yosh-matsuda avatar dependabot[bot] avatar takuji-hiraoka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.