--- id: sinter version: "1.16.0" license: Apache 2 license_treatment: permissive maintenance: active --- # sinter — Samples stim circuits and decodes them using pymatching. License: permissive · Maintenance: active · Downloads: 92.1K/mo ## What it is and what it does Sinter is a Python library and command-line tool for sampling quantum error correction circuits and measuring logical error rates. It takes Stim circuits annotated with noise, detectors, and logical observables, uses Stim to generate samples, applies a decoder to predict whether logical errors occurred from detector data, and records success and failure rates. The tool uses Python multiprocessing to parallelize sampling across multiple CPU cores, dynamically allocates additional samples to circuits that need them based on user-specified targets (such as a minimum error count), saves results in CSV format, and provides basic plotting utilities for visualization. Sinter is designed for single-machine benchmarking of quantum error correction codes. It scales well across machines with varying core counts (tested on 2, 4, and 96 core systems) and achieves good resource utilization when batch sizes are tuned appropriately. The library exposes both a Python API for programmatic use and a command-line interface for batch processing of circuit files, making it suitable for researchers prototyping and analyzing error correction schemes. Use it for: - Benchmark surface code implementations by sampling circuits at various physical error rates and measuring resulting logical error rates. - Compare decoder performance on the same set of QEC circuits by running collection with different decoders and analyzing CSV output. - Automate large-scale QEC sampling campaigns on a multi-core workstation, resuming interrupted runs without data loss via checkpoint files. - Generate plots of logical error probability versus physical error rate to visualize code performance across parameter sweeps. - Prototype and validate new quantum error correction codes by generating custom Stim circuits and collecting statistics via the Python API. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Sinter performs fast Monte Carlo sampling of quantum error correction circuits, using stim to generate samples and decoders like pymatching to predict logical errors from detector data. Yes, with conditions. Install if you are actively researching or benchmarking quantum error correction codes and have stim and a decoder like pymatching available. The high install friction (four runtime dependencies) and the requirement to structure code around multiprocessing make it less suitable for casual exploration, but the active maintenance, permissive license, and no known vulnerabilities make it safe for production research use. Verify that pymatching or your chosen decoder is available before committing to the full stack. ## Install pip install sinter uv add sinter poetry add sinter ## Installing sinter Before you install: High install friction: requires four runtime dependencies (matplotlib, numpy, stim, scipy). Maintenance status is active with a recent release (84 days ago), but the heavy dependency footprint and compiled components in stim may add setup complexity. License in practice: Licensed under Apache 2, a permissive license that allows commercial and private use with minimal restrictions—suitable for most research and production contexts. Quickstart: pip install sinter import sinter import stim tasks = [sinter.Task(circuit=stim.Circuit.generated(...), json_metadata={...})] samples = sinter.collect(num_workers=4, max_shots=1_000_000, max_errors=1000, tasks=tasks, decoders=['pymatching']) Requires Python >=3.7.0 and stim installed; multiprocessing-based collection must be wrapped in `if __name__ == '__main__'` to avoid child process re-execution. Verify before relying: - Whether pymatching is a required dependency or optional; description mentions it as a decoder but it is not listed in runtime deps. - Performance scaling characteristics on machines with different core counts beyond the stated testing range. - Compatibility with decoders other than pymatching and whether custom decoders can be plugged in. ## Package facts - License: Apache 2 (permissive) - Python support: supports_current - Install friction: high - Maintenance: active - Downloads: 92.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags quantum error correction sampling, QEC circuit benchmarking, stim circuit decoder, monte carlo QEC simulation, logical error rate measurement, quantum error correction analysis, surface code sampling, quantum-computing, error-correction, monte-carlo-simulation [View on SkillFed](https://skillfed.io/packages/sinter) · [View on PyPI](https://pypi.org/project/sinter/)