Mobius颜色码解码器的快速实现。
项目描述
Chromobius:颜色码解码器
Chromobius是一个"Mobius解码器"的实现,将颜色码解码问题近似为最小权重匹配问题。Chromobius使用PyMatching来求解最小权重匹配问题。
有关Chromobius工作原理的更多详细信息,请参阅((论文《新的电路和开源的颜色码解码器》))。
如何使用Chromobius
请参阅入门笔记本。
还可以查看Python API参考。
希望编辑和构建Chromobius的程序员可以查看开发者文档。
示例片段
使用Chromobius解码一帧
从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))
从命令行
# 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
使用sinter从Python
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,
)
使用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" \
项目详情
关闭
chromobius-1.1.0.tar.gz的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 085ebd50bf897df63076e6dfe89cde20afc412260d7462c0415735ee0a8eb338 |
|
MD5 | 661dbeb6957aedb0262bf815ace04f64 |
|
BLAKE2b-256 | aba1e10b3af5027163bcfee7351f596025fbeb246def21f843c02596d24f95b8 |
关闭
哈希值 为 chromobius-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 58d947cc3a11e072ab36e2f0053d69e41a83231954ea5f38ef1c8c6f5eedd5c2 |
|
MD5 | 67399082745edaa27ecb4e425c8d8a50 |
|
BLAKE2b-256 | a9b543c260d3bcd04a27d87ad197a2d342dcd720614f473f13055787f96c9e09 |
关闭
哈希值 为 chromobius-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 5f9bc1594100420f43cfa9ee7f904cd931b84a99e999074bcfddc4c797d5ada8 |
|
MD5 | d2c240bd66967645c4e245a6fa8a8223 |
|
BLAKE2b-256 | d9120f6119e8a9a77244b9be0fb02848b6f08f31d80fe1ebe0b21fe32412115d |
关闭
哈希值 为 chromobius-1.1.0-cp312-cp312-macosx_10_15_x86_64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 9db402694e1ffc813dddb37fddd74c74dc15b68fa1813860f4e2b3b170253995 |
|
MD5 | af4956f84ebb1d15873b23e2930bd6d7 |
|
BLAKE2b-256 | 10bf6258e3e23ebce4f611239330caeaea7370601fd8dbcf7ffa0d1a559ab6fd |
关闭
哈希值 为 chromobius-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 029898b0e9caf878fc01d64cd08972df180334643f4f6f3263129cb0ba1e1bf9 |
|
MD5 | ae8b7a5acae42e50f81783ef25d950f2 |
|
BLAKE2b-256 | 0a5e97785ca9b02a7c577cb2e5aa2d93077aadc06fc39dfc07a67e1882225f56 |
关闭
哈希值 为 chromobius-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 02739e862b15ff908c5ac2379cfb2431c277c60c271094713f488143ed55cbbb |
|
MD5 | f748bc47ec260d12e62cabc1202133d2 |
|
BLAKE2b-256 | 48f756248b552d741d824059be7eae9f7eabb23e6004e5834f16469897535c99 |
关闭
哈希值 为 chromobius-1.1.0-cp311-cp311-macosx_10_15_x86_64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | a789e17a8e2c4ed2c59137f2818a22bd5451993581fca7e7eb9ff52aa92aaf8d |
|
MD5 | ba9537588ed9917379267907672270b1 |
|
BLAKE2b-256 | 846a1e0ed815cebfb195f22ee0f7022e31061739432cedb862e40734019c095d |
关闭
哈希值 为 chromobius-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0d5800d0b7c2d97ea943481ca741a7bd60dcaddc01dc1984aa6e29b1f07ad6c4 |
|
MD5 | 173f4cce7947a530bf867ddb8d41c81a |
|
BLAKE2b-256 | 0cae25459673ca074fff4ac082ff0214d1cdb41a310b0319694eededd500585f |
关闭
哈希值 为 chromobius-1.1.0-cp310-cp310-macosx_11_0_arm64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 25009231fe0425e6cc45051742abdaca7d012d470b1b813becdaeb08e1671de9 |
|
MD5 | ab430e0d363c60d9a2312b5cd81145ea |
|
BLAKE2b-256 | 4e2139a91d17172da331cc2b031c0517364d3c224d2aa2bfcd57ed1df57fceee |
关闭
哈希值 为 chromobius-1.1.0-cp310-cp310-macosx_10_15_x86_64.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 7c1b24ce858bedac9c42b3088b6514dce39adbc739c53ead49d7433345a260c4 |
|
MD5 | 7050862a3bb206cdb4f8d1a7c7208e84 |
|
BLAKE2b-256 | cd395b9a7cd01cc265e918ebac79df684a196e18c09921bf1424ecf7ff4ad17f |