Skip to content

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

License

Notifications You must be signed in to change notification settings

cduck/ChpSim.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages