Giter Site home page Giter Site logo

qiskit_surface_codes-1's Introduction

Qiskit Surface Code Encoder/Decoder

IBM Qiskit - Summer Jam Hackathon 2020

Quantum computation is an inherently noisy process. Scalable quantum computers will require fault-tolerance to implement useful computation. There are many proposed approaches to this, but one promising candidate is the family of topological quantum error correcting codes.

Currently, the qiskit.ignis.verification.topological_codes module provides a general framework for QEC and implements one specific example, the repetition code.

For the hackathon, our team Erwin's Tigers implemented a surface code encoder and decoder for Qiskit Ignis. We hope that this implementation will be useful to other Qiskitters and will inspire others to continue building out the topological_codes module into a diverse family.

Usage

Inspired by the Qiskit Textbook, we've written a full set of jupyter notebook tutorials, which are the best way to get up to speed. They detail both the API and the gritty implementation details -- please check them out!

Background

surface code teaser

Surface codes are a type of CSS code, consisting of pairwise commuting X and Z stabilizers made of Pauli gates. It defines a logical state on a 2 by 2 lattice made of quantum bits with the stabilizers X1 X2 Z1 Z2.

The code is based on the earlier theoretical idea of a toric code, with periodic boundary conditions instead of open boundary conditions. This has been shown to be largely identical, but embedding a surface code on an actual device is much easier.

Implementation

In general, we try to follow the existing structure of qiskit.ignis.verification.topological_codes. The code is implemented separately here but is able to easily be merged into Ignis.

There are two main interfaces โ€” corresponding to the encoder and decoder, respectively:

SurfaceCode in surface_code.circuits

SurfaceCode(d, T) generates a QuantumCircuit for creating a logical state and measuring stabilizers. The class is parameterized with the code distance d (which should be odd) and the number of syndrome measurement rounds T (usually T = d). This class also handles parsing of the physical device readout into a form suitable for decoding. Please see the encoder tutorial for a full walkthrough.

circuit

GraphDecoder in surface_code.fitters

GraphDecoder(d, T) implements minimum-weight perfect matching (MWPM) on the syndrome measurements of the physical circuit. This class is similar to the existing GraphDecoder for repetition codes, but introduces a new framework to handle the 2D lattice.

Parsed readout from the device is used to generate graphs of error chains in time and space, which decode syndrome measurements into the most likely sequence of qubit flips over time. Please see the decoder tutorial for a full walkthrough.

matching graph

Future Directions

The scope of the project is quite large, so we focused on completing a "minimum viable product" during the hackathon. However, there are many areas which we'd like to explore going forward. A few immediate ones:

  • Expand SurfaceCode(d, T).circuits a full set of logical states (1, +, -) -- and ultimately logical gate operations for computation.
  • Full benchmark of the physical-error to logical-error probabilities to determine the error correction threshold
  • More simulation runs: different X/Z error probabilities, more limited coupling_map, etc.
  • Our MWPM matching already has the below improvements to the basic algorithm, but are there more?
    • For a given pair of syndromes, there may be many possible error chains through space and time. We compute this "path degeneracy" and use it to re-weight the error probabilities.
    • We cross-match X and Z errors to produce an overall Y error. However, this doesn't exactly match a depolarizing channel, so ideally the weights would be re-adjusted with conditional probabilities.
  • Other approaches to error-chain matching (e.g. neural networks or tensor networks)?
  • Our GraphDecoder implements two different approaches to syndrome graph generation. One is a "analytic" approach (much faster), and the other uses simulation to insert errors into the circuit. These produce slightly different syndrome graphs, but we get the same decoding results in our tests.

Team

Acknowledgements

We would like to thank James Wootton for valuable suggestions and feedback. Our code closely follows his RepetitionCode structure in qiskit.ignis.verification.topological_codes, and his tutorials closely guided our initial explorations.

We'd also like to thank Doug McClure for advising us on helpful details of the IBM hardware.

References

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.