Git Product home page Git Product logo

stabilizer_code's Introduction

Stabilizer codes

Implementation of stabilizer codes in pyQuil

CS269Q Spring 2018-19 course project

Authors: Shubham Chandak, Jay Mardia, Meltem Tolunay

Instructor: Will Zeng

Installation

Follow instructions to install qvm and quilc from http://docs.rigetti.com/en/stable/. Then just run

git clone https://github.com/shubhamchandak94/stabilizer_code

to download the code.

Defining a stabilizer code

The stabilizer codes are defined here in terms of the stabilizer generator matrix and the error correction capabilities of the code. The error correction capability is defined in terms of a dictionary mapping the error type to the number of such errors the code can correct. Currently supported error types are X, Y, Z on single qubits and a combination of X and Z on different qubits. Some examples of stabilizer codes along with the parameters are provided in stabilizer_check_matrices.py.

Generating programs for encoding and decoding a stabilizer code

Given a stabilizer code representation my_stabilizer_code in the format as described above, run the following

import stabilizer_code
code = stabilizer_code.StabilizerCode(my_stabilizer_code)

Then code.encoding_program and code.decoding_program are the encoding and decoding programs, respectively.

Running basic tests

First run qvm -S and quilc -S before running any tests.

Several standard stabilizer matrices are defined in stabilizer_check_matrices.py

To run basic tests (bit flip, phase flip etc. with different initial states) for all codes in above file, run python3 basic_tests.py

To run basic tests for a specific code, run with the name of the code, e.g., python3 basic_tests.py bit_flip_code

Plotting logical error rates vs physical error rates

First run qvm -S and quilc -S before running any tests. Then run the function logical_vs_physical_error_rates.py after changing the parameters in the main appropriately (examples provided in the code).

Plotting logical error rates vs code rates

First run qvm -S and quilc -S before running any tests. Then run the function PlotCodeRateVsErrRate from code_rate_vs_logical_error_rate.py with appropriate arguments (examples provided in the code)

stabilizer_code's People

Contributors

jmardia avatar shubhamchandak94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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