mwpf-decoding

mwpf-decoding is a skill for Claude Code, Codex from xi-zhao/OpenQuantum. It costs 66 tokens per session (1,622 once invoked), scanned A, original, MIT.

A quantum-error-correction decoding workspace for weighted hypergraphs and detector data. It uses MWPF, with Stim and Sinter support for estimating logical observable flips.

In plain words
What is it for?
Use it to solve custom weighted-hypergraph syndromes, inspect selected edges and weight bounds, and estimate logical errors from Stim circuits or detector error models with Sinter.
Why use it?
It helps compare decoding methods on problems where one error can connect several detectors, while keeping solution weights and bounds for review. It also makes small decoding cases reproducible instead of relying on undocumented solver settings.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to solve custom weighted-hypergraph syndromes, inspect selected edges and weight bounds, and estimate logical errors from Stim circuits or detector error models with Sinter.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xi-zhao/openquantum/mwpf-decoding
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add xi-zhao/OpenQuantum --skill mwpf-decoding
Clone the repo
git clone --depth 1 https://github.com/xi-zhao/OpenQuantum

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mwpf-decoding

README.md
[![agentmods](https://agentmods.dev/badge/skills/xi-zhao/openquantum/mwpf-decoding/github.svg)](https://agentmods.dev/skills/xi-zhao/openquantum/mwpf-decoding)
Your own site
<a href="https://agentmods.dev/skills/xi-zhao/openquantum/mwpf-decoding"><img src="https://agentmods.dev/badge/skills/xi-zhao/openquantum/mwpf-decoding/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mwpf-decoding

Your own site · 80×15
<a href="https://agentmods.dev/skills/xi-zhao/openquantum/mwpf-decoding"><img src="https://agentmods.dev/badge/skills/xi-zhao/openquantum/mwpf-decoding.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,622 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00066 $0.01622
Opus 5.5 $0.00026 $0.00649
Sonnet 5.5 $0.00013 $0.00324
Haiku 4.5 $0.00007 $0.00162

Measured 12d ago against content hash 9a1523b9a3bb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mwpf-decoding scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (references/native-example.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/mwpf-decoding/SKILL.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MWPF 超图译码

原生 SDK 路径

本能力使用 MWPF 的原生公开 API。用户需要 用户自定义加权超图、syndrome 与权重界,以及 Stim/Sinter 逻辑 observable 译码 时,由 Agent 在固定依赖环境中编写和运行任务代码。

使用 node scripts/sdk-access.mjs inspect mwpf-decoding 定位环境,按完整 SDK 工作流执行。模块导航:mwpf、stim、sinter、numpy;导航不是 API 白名单。

固定 MWPF 0.2.18;Sinter 必须显式 PanicAction.RAISE,有限 cluster 预算可回退 UF,float64 权重界不是形式化证明。一般超图求解无最坏耗时保证;使用宿主进程预算。

本入口复用宿主文件与代码工具,没有新增通用执行 Tool。原生 SDK 受上游版本、可选依赖、宿主资源与用户授权约束。已禁用或被拒绝的动作不能借代码路径绕过。执行状态和科研验收分别报告。

方法选择与准备

需要直接表达加权超图及权重界时选择 MWPF;图状匹配可继续用 PyMatching,BP/OSD/LSD 可用 ldpc-decoding,带颜色/基标注的色码可用 Chromobius。不要为套用某个译码器改变原始模型。

按 SDK 工作台显式准备环境,再运行原生程序。准备下载并写入依赖;执行本身不安装。 固定 Python 3.12、MWPF 0.2.18、Stim/Sinter 1.16.0 与 NumPy 2.5.3,其余版本见 uv.lock。 这是可选 L0 SDK/Skill,不新增 Tool、MCP Server、常驻进程或科学验收器。

原生任务流程

  1. 保存加权超图/校验约束、syndrome,或原始 circuit/DEM、detector/observable 定义、噪声模型与种子。 使用 HyperEdge、SolverInitializer、SolverSerialJointSingleHair 和 SyndromePattern 求解。 subgraph_range() 返回选中边和上下界;分别保存解权重、上下界、配置和实际差距。
  2. 原生 solver 省略 cluster_node_limit 才使用上游默认的大预算;0 是有限预算,不表示无限。 Sinter 默认值为 50;达到预算可退回 Union-Find。不要把成功返回等同于最优解,也不要编造每次回退标志。 Sinter 的 timeout 字段没有通过其 config 传给核心,不能拿它当整次任务时限;使用宿主进程预算/取消机制。
  3. 使用 Sinter 时必须显式设置 panic_action=mwpf.PanicAction.RAISE。上游默认 CATCH 会在译码异常后 返回随机预测,不能用于可信比较。保留异常和失败输入;不得统计随机替代预测为成功结果。
  4. compile_decoder_for_dem 后调用 decode_shots_bit_packed;输入为二维 uint8、每 shot ceil(num_detectors/8) 字节、little-endian。输出宽度按 observable 数计算,不能与 detector 混用。 可编辑示例显式检查输入宽度并抛出错误。
  5. DEM 会丢失部分 heralded erasure 上下文;需要时按上游 with_circuit(circuit) 传原电路, 并单独验证该路径。本接入未验证 heralded erasure,不擅自分解或近似 DEM。
  6. 比较译码器时共用同一噪声模型、输入样本和预算,保留原始 samples、实际/预测 observables、失败记录和版本。 样本量由用户任务决定;固定种子不保证跨版本/平台逐位相同。

示例与自定义程序

在新输出目录用 inspect 给出的解释器运行 references/native-example.py:默认解一个独立可枚举的超图。 --input graph.json 接受 vertex_count、edges([[顶点列表, 权重], ...])和 syndrome。 --dem model.dem --shots 1024 --seed 7 在原始 DEM 上采样与译码,保存 result.json 和 samples.npz。 --cluster-node-limit N 显式选择有限预算;无此参数时,超图模式用核心默认值,DEM 模式用 Sinter 默认 50。 示例不覆盖已有结果文件。用户可直接编写原生 API 程序,不受示例对象大小或预设任务限制。

Read the full file on GitHub · 73 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 73 lines · 66 tokens per session scan A 9a1523b9a3bb

Subscribe to this mod's changes

mwpf-decoding is a skill published in the GitHub repository xi-zhao/OpenQuantum (75 stars, last pushed 5d ago), licensed MIT. It adds 66 tokens to every session and 1,622 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-22.

Related

mwpf-decoding compared with skills from other repositories

mwpf-decoding next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mwpf-decodingxi-zhao/OpenQuantumSkill755d agoMITA66Claude Code, Codex
manim-animatorsandbaseai/sandbase-skillsSkill21212d agoApache-2.0A59Claude Code
academic-researchsandbaseai/sandbase-skillsSkill21212d agoApache-2.0A39Claude Code
academic-trend-researchsandbaseai/sandbase-skillsSkill21212d agoApache-2.0A43Claude Code
openalex-guidecyanheads/openalex-mcp-serverSkill1816d agoApache-2.0A96Claude Code
arxiv-guidecyanheads/arxiv-mcp-serverSkill7yesterdayApache-2.0A81Claude Code
alexandriaThe-40-Thieves/alexandria-mcpSkill317d agoMITA71Claude Code