Clifford circuits and other quantum Stabilizer formalism tools.
Author Krastanov
19 Stars
Updated Last
1 Year Ago
Started In
July 2019


Documentation of latest stable version Documentation of dev version GitHub Workflow Status Test coverage from codecov

A Julia package for working with quantum stabilizer states and Clifford circuits that act on them. The package is already very fast for the majority of common operations, but there are still many low-hanging fruits performance-wise. See the detailed suggested readings & references page for background on the various algorithms.

To install it use:

] add QuantumClifford

Works efficiently with pure and mixed stabilizer states of thousands of qubits as well as sparse or dense Clifford operations acting upon them.

Provides canonicalization, projection, and generation operations, as well as partial traces.

julia> P"X" * P"Z"

julia> P"X" ⊗ P"Z"
+ XZ

julia> S"-XX
- XX
+ ZZ

julia> CNOT * S"-XX
- X_
+ _Z

Quick Benchmarks

Fast, in-place, (mostly) allocation free implementations. Operations on states are very efficient. Operations modifying the Clifford operators themselves are not yet as efficient.

Canonicalization of a random 100-qubit stabilizer

julia> @benchmark canonicalize!(s) setup=(s=random_stabilizer(100))
  memory estimate:  0 bytes
  allocs estimate:  0
  minimum time:     139.927 μs (0.00% GC)
  median time:      161.090 μs (0.00% GC)
  mean time:        165.824 μs (0.00% GC)
  maximum time:     278.056 μs (0.00% GC)
  samples:          376
  evals/sample:     1

Gate application (50 CNOT gates on 100 qubits)

julia> @benchmark apply!(s, gate) setup=(s=random_stabilizer(100); gate=tensor_pow(CNOT,50))
  memory estimate:  752 bytes
  allocs estimate:  11
  minimum time:     248.900 μs (0.00% GC)
  median time:      277.454 μs (0.00% GC)
  mean time:        277.948 μs (0.00% GC)
  maximum time:     338.304 μs (0.00% GC)
  samples:          236
  evals/sample:     1

Sparse gate application to only specified qubits

julia> @benchmark apply!(s, CNOT, [32,54]) setup=(s=random_stabilizer(100))
  memory estimate:  832 bytes
  allocs estimate:  12
  minimum time:     6.480 μs (0.00% GC)
  median time:      7.350 μs (0.00% GC)
  mean time:        7.435 μs (0.00% GC)
  maximum time:     15.171 μs (0.00% GC)
  samples:          490
  evals/sample:     6

Used By Packages

No packages found.