GithubHelp home page GithubHelp logo

cduck / chpsim.jl Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 8 KB

A simple Julia library for simulation of stabilizer circuits (quantum circuits with only Clifford gates)

License: MIT License

Julia 100.00%

chpsim.jl's Introduction

ChpSim

A simple simulator for quantum stabilizer circuits based on Scott Aaronson, Daniel Gottesman, Improved Simulation of Stabilizer Circuits for Julia. Adapted from a Python implementation and uses a similar API.

This simulator can efficiently simulate Clifford operations on many qubits but does not support non-Clifford operations.

Install

Install ChpSim with Julia's package manager:

julia -e 'using Pkg; Pkg.add("ChpSim")'

Examples

using ChpSim
sim = ChpState(6)

hadamard!(sim, 1)     # Hadamard gate on the first qubit
phase!(sim, 6)        # S gate on the last qubit
cnot!(sim, 2, 3)      # CNOT gate with control on qubit 2 and target on 3
r = measure!(sim, 3)  # Measure qubit 3

r.value       # The boolean measurement, true or false
r.determined  # False if the qubit was in superposition before measurement
# Uses 1/8 the memory but is typically slower
using ChpSim
sim = ChpState(6, bitpack=true)

chpsim.jl's People

Contributors

cduck avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

eshaspark

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.