| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Installation · Quick Example · Documentation · Rust · Citing
PECOS (Performance Estimator of Codes On Surfaces) is a framework/library for exploring, developing, and evaluating quantum error correction protocols and hybrid quantum-classical programs.
Quantum error correcting since 2014. Fast simulators, from stabilizer to GPU. User-friendly Python API. Blazingly fast Rust core. Supported by Quantinuum.
Python:
pip install quantum-pecosRust: Add to your Cargo.toml:
pecos = { version = "0.1", features = ["qasm"] }For Julia or optional features (LLVM, CUDA), see the Getting Started Guide.
Simulate a distance-3 repetition code with syndrome extraction using Guppy, a pythonic quantum programming language:
from pecos import Guppy, sim, state_vector, depolarizing_noise
from guppylang import guppy
from guppylang.std.quantum import qubit, cx, measure
from guppylang.std.builtins import array, result
@guppy
def repetition_code() -> None:
# 3 data qubits encode logical |0⟩ = |000⟩
d0, d1, d2 = qubit(), qubit(), qubit()
# 2 ancillas for syndrome extraction
s0, s1 = qubit(), qubit()
# Measure parity between adjacent data qubits
cx(d0, s0)
cx(d1, s0)
cx(d1, s1)
cx(d2, s1)
# Extract syndromes as an array
result("syndrome", array(measure(s0).read(), measure(s1).read()))
# Measure data qubits (required by Guppy)
_ = measure(d0).read(), measure(d1).read(), measure(d2).read()
# Run 10 shots with 10% depolarizing noise
noise = depolarizing_noise().with_uniform_probability(0.1)
results = sim(Guppy(repetition_code)).qubits(5).quantum(state_vector()).noise(noise).seed(42).run(10)
print(results["syndrome"])
# [[1, 1], [0, 1], [0, 0], [1, 1], [0, 0], [0, 1], [1, 1], [0, 0], [0, 1], [0, 1]]Non-trivial syndromes like [1, 0], [0, 1], [1, 1] indicate detected errors that a decoder would use to identify and correct faults.
For OpenQASM, PHIR, or other formats, see the documentation. For a Rust example, see For Rust Users below.
For tutorials, API reference, and advanced features:
Before version 1.0.0, breaking changes may occur between minor versions (e.g., 0.1.0 → 0.2.0). We recommend pinning to a specific version in production.
If you use PECOS in your research, please cite:
@misc{pecos,
author={Ciar\'{a}n Ryan-Anderson},
title={PECOS: Performance Estimator of Codes On Surfaces},
howpublished={\url{https://github.com/PECOS-packages/PECOS}},
year={2018}
}For additional citation formats (PhD thesis, Zenodo DOI), see the full documentation.
Apache-2.0 — see LICENSE for details.
The pecos crate is the main entry point—a metacrate that re-exports functionality from the underlying crates. Enable features for what you need:
[dependencies]
pecos = { version = "0.1", features = ["qasm", "phir"] }Common features: qasm (OpenQASM support), phir (PHIR support), llvm (LLVM IR execution), cli (command-line tools). See docs.rs/pecos for the full list.
Each crate also works standalone—use just pecos-simulators for simulation or pecos-qec for error correction without the full framework. Trait-based design makes it easy to swap implementations or integrate into your own tools.
Both Rust and Python are designed to be modular. Extend or replace components without forking.
See the Development Guide to get started contributing.
| Back | FazBrowse Home | New Git URL |