GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - PECOS-packages/PECOS: Software for exploring, developing, and evaluating quantum error-correction protocols.

BranchesTags
Open more actions menu

Latest commit

 

History

1,149 Commits
1,149 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
crates
crates
 
 
docs
docs
 
 
examples
examples
 
 
exp
exp
 
 
images
images
 
 
julia
julia
 
 
python
python
 
 
scripts
scripts
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.markdownlint.json
.markdownlint.json
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.python-version
.python-version
 
 
.typos.toml
.typos.toml
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
Justfile
Justfile
 
 
LICENSE
LICENSE
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
RELEASING.md
RELEASING.md
 
 
SECURITY.md
SECURITY.md
 
 
conftest.py
conftest.py
 
 
deny.toml
deny.toml
 
 
mkdocs.yml
mkdocs.yml
 
 
osv-scanner.toml
osv-scanner.toml
 
 
pyproject.toml
pyproject.toml
 
 
ruff.toml
ruff.toml
 
 
uv.lock
uv.lock
 
 

Repository files navigation

PECOS

PyPI version Crates.io Documentation Status Python versions Supported by Quantinuum

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.

Installation

Python:

pip install quantum-pecos

Rust: Add to your Cargo.toml:

pecos = { version = "0.1", features = ["qasm"] }

For Julia or optional features (LLVM, CUDA), see the Getting Started Guide.

Quick Example

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, 0], [1, 0], [0, 0], [0, 0], [0, 1], [0, 1], [0, 1], [0, 0], [1, 0], [1, 0]]

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.

What Can You Do With PECOS?

  • Simulate quantum circuits using fast simulators ideal for error correction research
  • Study quantum error correction codes with tools for syndrome extraction, decoding, and analysis
  • Run hybrid quantum-classical programs with support for classical control flow, conditionals, and Wasm
  • Add realistic noise to understand how errors affect your circuits
  • Choose your backend: stabilizer simulation, state vector, or GPU-accelerated options

Documentation

For tutorials, API reference, and advanced features:

  • Getting Started Guide — Installation, first simulation, next steps
  • PECOS Concepts — Detectors, observables, tracked operators, gates, and noise
  • Simulators Guide — Choosing the right backend
  • Noise Model Builders — Adding realistic noise
  • Decoders Guide — Quantum error correction decoding
  • Full Documentation — Complete API reference

Versioning

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.

Citing

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.

License

Apache-2.0 — see LICENSE for details.


For Rust Users

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.


For Contributors

Repository Structure

  • /python/quantum-pecos/ — Main Python package (imports as pecos)
  • /python/pecos-rslib/ — Rust extensions for Python
  • /crates/pecos/ — Main Rust metacrate (re-exports other crates)
  • /crates/pecos-*/ — Individual Rust crates (simulators, engines, etc.)
  • /julia/ — Experimental Julia bindings
  • /docs/ — Documentation source

Both Rust and Python are designed to be modular. Extend or replace components without forking.

See the Development Guide to get started contributing.


Quantinuum

About

Software for exploring, developing, and evaluating quantum error-correction protocols.

Topics

clifford-circuitserror-modelingnisqpythonqecquantumquantum-codesquantum-computer-simulatorquantum-computingquantum-error-correctionquantum-programmingquantum-programming-languagequantum-simulationqubitsrustsimulationstabilizer-circuitsstabilizer-codestabilizer-states

Resources

Readme
Apache-2.0 license

Security policy

Security policy
Activity
Custom properties

Stars

64 stars

Watchers

2 watching

Forks

18 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.