Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Chromobius: color code decoder

Chromobius is an implementation of a "mobius decoder", which approximates the color code decoding problem as a minimum weight matching problem. Chromobius uses PyMatching to solve the minimum weight matching problem.

See ((((the paper "New circuits and an open source decoder for the color code")))) for more details on how Chromobius works.

How to use Chromobius

See the getting started notebook.

Also see the python api reference.

Programmers who want to edit and build Chromobius can check the developer documentation.

Example Snippets

Decoding a shot with Chromobius

From python:

import stim
import chromobius
import numpy as np

def count_mistakes(circuit: stim.Circuit, shots: int) -> int:
    # Sample the circuit.    
    dets, actual_obs_flips = circuit.compile_detector_sampler().sample(
        shots=shots,
        separate_observables=True,
        bit_packed=True,
    )

    # Decode with Chromobius.
    decoder = chromobius.compile_decoder_for_dem(circuit.detector_error_model())
    predicted_obs_flips = decoder.predict_obs_flips_from_dets_bit_packed(dets)

    # Count mistakes.
    return np.count_nonzero(np.any(predicted_obs_flips != actual_obs_flips, axis=1))

From the command line:

# Sample shots of detectors and observable flips.
stim detect \
    --shots 100000 \
    --in "example_circuit.stim" \
    --out "dets.b8" \
    --out_format "b8" \
    --obs_out "obs_actual.txt" \
    --obs_out_format "01"
    
# Extract a detector error model used to configure Chromobius.
stim analyze_errors \
    --in "example_circuit.stim" \
    --fold_loops \
    --out "dem.dem"

# Decode the shots.
chromobius predict \
    --dem "dem.dem" \
    --in "dets.b8" \
    --in_format "b8" \
    --out "obs_predicted.txt" \
    --out_format "01"

# Count the number of shots with a prediction mistake.
paste obs_actual.txt obs_predicted.txt \
    | grep -Pv "^([01]*)\\s*\\1$" \
    | wc -l

From python using sinter:

import sinter
import chromobius
import os

tasks: list[sinter.Task] = ...
stats: list[sinter.TaskStats] = sinter.collect(
    decoders=["chromobius"], 
    custom_decoders=chromobius.sinter_decoders(),
    tasks=tasks,
    num_workers=os.cpu_count(),
    max_shots=100_000,
    max_errors=100,
)

From the command line using sinter:

sinter collect \
    --circuits "example_circuit.stim" \
    --decoders chromobius \ 
    --custom_decoders_module_function "chromobius:sinter_decoders" \
    --max_shots 100_000 \
    --max_errors 100
    --processes auto \
    --save_resume_filepath "stats.csv" \

Metadata

Release files for chromobius 1.2.dev1760419877

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for chromobius 1.2.dev1760419877
File
chromobius-1.2.dev1760419877-cp312-cp312-macosx_10_15_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.15+ x86-64 Details
chromobius-1.2.dev1760419877-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
chromobius-1.2.dev1760419877-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
chromobius-1.2.dev1760419877-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.26+ ARM64, Linux glibc 2.28+ ARM64 Details
chromobius-1.2.dev1760419877-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
chromobius-1.2.dev1760419877-cp311-cp311-macosx_10_15_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.15+ x86-64 Details
chromobius-1.2.dev1760419877-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
chromobius-1.2.dev1760419877-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
chromobius-1.2.dev1760419877-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ ARM64, Linux glibc 2.26+ ARM64 Details
chromobius-1.2.dev1760419877-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
chromobius-1.2.dev1760419877-cp310-cp310-macosx_10_15_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.15+ x86-64 Details

Total release size: 13.2 MB

Release files / chromobius-1.2.dev1760419877-cp312-cp312-macosx_10_15_x86_64.whl

Download URL chromobius-1.2.dev1760419877-cp312-cp312-macosx_10_15_x86_64.whl
Size 952.8 kB
Tags CPython 3.12 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
ddfbd93079b3fbfb32399fe3c408959670b7d2be698fbf95cb8a18fd275df6e1
BLAKE2b-256 checksum
How to use checksums
daa9cb89e2ec1c8d3b9d440b73c142ede59662df0fe5f040095998c8ae9c78fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / chromobius-1.2.dev1760419877-cp311-cp311-win_amd64.whl

Download URL chromobius-1.2.dev1760419877-cp311-cp311-win_amd64.whl
Size 2.0 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
712912d3d07e15d1af76a1af7a11bb487c8cb1c7ce490b3f5143bf029c7291d0
BLAKE2b-256 checksum
How to use checksums
f1c3866f8c0e4376deb43035884909902a13e3563e3db302e53efeb94de44951
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / chromobius-1.2.dev1760419877-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL chromobius-1.2.dev1760419877-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.2 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a610756b8913853e4a4bef6fdd5ff39cbd3eebb8c3b2177ef0e8201f2084d38b
BLAKE2b-256 checksum
How to use checksums
ab728df2daa5da9035f5a44d80e50aa92155de59960396efce5e29385d362d96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / chromobius-1.2.dev1760419877-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL chromobius-1.2.dev1760419877-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.1 MB
Tags CPython 3.11 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
2d0a270833857f6a1e2cd41bb14af872b930a54e814758e8283d24b9fded3db5
BLAKE2b-256 checksum
How to use checksums
b0204657bf11cadb2b3381ce63b5464d7e8c23f3fad50f3a1223f44fd4b03888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / chromobius-1.2.dev1760419877-cp311-cp311-macosx_11_0_arm64.whl

Download URL chromobius-1.2.dev1760419877-cp311-cp311-macosx_11_0_arm64.whl
Size 879.1 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e9371e826c349dae1e1ed729403f8bb5ccb3f3ab23857822e1e7430c12538f3b
BLAKE2b-256 checksum
How to use checksums
643046fd314992e1539aa4eb7ad84f9334b485e7ddb9f3ea24ea1d0c867c638f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / chromobius-1.2.dev1760419877-cp311-cp311-macosx_10_15_x86_64.whl

Download URL chromobius-1.2.dev1760419877-cp311-cp311-macosx_10_15_x86_64.whl
Size 953.2 kB
Tags CPython 3.11 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
5cfed36191e8874302fda028cebcffdb6380cbc8b004df78ede4fb8338c1284a
BLAKE2b-256 checksum
How to use checksums
c1a6f06194599e96ac6f988e31d33f90d65317bb52d9298d3f3679f71c88ffde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / chromobius-1.2.dev1760419877-cp310-cp310-win_amd64.whl

Download URL chromobius-1.2.dev1760419877-cp310-cp310-win_amd64.whl
Size 2.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
4ed9c03650dec1294011d398cecd1d8f587a5c344455eef82c8056972e99cffb
BLAKE2b-256 checksum
How to use checksums
7d17879e9fa3bb54cb2e7e68cf48bdcb0ded79c76cae36aa3f97c9f5fb987830
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / chromobius-1.2.dev1760419877-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL chromobius-1.2.dev1760419877-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 1.2 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0c1068ef5f1a7a5423cb4ef07d620603cbda50de7d5b1c4a7fa61c4b2c2ebce2
BLAKE2b-256 checksum
How to use checksums
1df285d4eb8a371008cba8d873c6cb4c66d83cfca76d44a8ad0bf63e8cae26eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / chromobius-1.2.dev1760419877-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl

Download URL chromobius-1.2.dev1760419877-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Size 1.1 MB
Tags CPython 3.10 Linux glibc 2.26+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
07ccba72cc169b89a4cbfee89a881b537c73ddd955fa76f7c14118620faa1471
BLAKE2b-256 checksum
How to use checksums
6a9305787a1746228ae5241528b3673b544f659189d9d08f8e71dae5786ff0e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / chromobius-1.2.dev1760419877-cp310-cp310-macosx_11_0_arm64.whl

Download URL chromobius-1.2.dev1760419877-cp310-cp310-macosx_11_0_arm64.whl
Size 878.4 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a8a7aa65eb75d2a96b3949a08c7a824c248190414630b8fc245be876fc03e2a0
BLAKE2b-256 checksum
How to use checksums
96a9112562836d12d9ff22b48ee6c6f14fa4546d6f159d0627de0db02e267cde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / chromobius-1.2.dev1760419877-cp310-cp310-macosx_10_15_x86_64.whl

Download URL chromobius-1.2.dev1760419877-cp310-cp310-macosx_10_15_x86_64.whl
Size 951.8 kB
Tags CPython 3.10 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
f9fc51bb08dff6d143c778316fbc9caf1c1c1fb615ac4879a502c33e3c8d394c
BLAKE2b-256 checksum
How to use checksums
26d0b717290fed516623f3deddb851de7c1641c4622c0acc4ae0a065ac376206
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page