clifft-sampling

clifft-sampling is a skill for Claude Code, Codex from xi-zhao/OpenQuantum. It costs 50 tokens per session (1,156 once invoked), scanned A, original, MIT.

A local sampler for Clifford+T quantum circuits with a specified single-qubit depolarizing error after each gate. It returns final computational-basis samples and can compare them with an independent density-matrix calculation.

In plain words
What is it for?
Use it to run supported H, S, T, Pauli, controlled-NOT, and controlled-Z circuits from the all-zero state, inspect sampled bit strings, and compare observed frequencies with reference probabilities. A density matrix is a numerical representation of a quantum state that includes mixtures caused by noise.
Why use it?
It lets you study how gate noise and T gates affect measured outcomes without requiring quantum hardware. The density-matrix comparison describes the same simulated noise model and does not remove the uncertainty caused by finite samples.

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 run supported H, S, T, Pauli, controlled-NOT, and controlled-Z circuits from the all-zero state, inspect sampled bit strings, and compare observed frequencies with reference probabilities. A density matrix is a numerical representation of a quantum state that includes mixtures caused by noise.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xi-zhao/openquantum/clifft-sampling
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 clifft-sampling
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 clifft-sampling

README.md
[![agentmods](https://agentmods.dev/badge/skills/xi-zhao/openquantum/clifft-sampling/github.svg)](https://agentmods.dev/skills/xi-zhao/openquantum/clifft-sampling)
Your own site
<a href="https://agentmods.dev/skills/xi-zhao/openquantum/clifft-sampling"><img src="https://agentmods.dev/badge/skills/xi-zhao/openquantum/clifft-sampling/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 clifft-sampling

Your own site · 80×15
<a href="https://agentmods.dev/skills/xi-zhao/openquantum/clifft-sampling"><img src="https://agentmods.dev/badge/skills/xi-zhao/openquantum/clifft-sampling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,156 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.00050 $0.01156
Opus 5.5 $0.00020 $0.00462
Sonnet 5.5 $0.00010 $0.00231
Haiku 4.5 $0.00005 $0.00116

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

Security

Grade A, and why

clifft-sampling 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 4d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (mcp/bridge.py, mcp/contracts.mjs, mcp/qec-contracts.mjs, …), 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/clifft-sampling/SKILL.md · 45 lines

How it starts

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

Clifft 近 Clifford 采样

原生 SDK 路径

本能力同时支持 Clifft / Stim 的原生公开 API。用户需要 自定义电路、噪声模型、测量与采样程序 时,由 Agent 在固定依赖环境中编写和运行任务代码,不限于下文便捷 Tool 的预设模型。

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

下文关于模型、门集、输入与预算的限制描述便捷 Tool 的合同;原生 SDK 另受上游版本、可选依赖、宿主资源与用户授权约束。已禁用或被拒绝的动作不能借代码路径绕过。执行状态和科研验收分别报告。

结构化最终测量调用 Harness 注册的 clifft_local.sample_clifft_circuit。用于 T 门干涉、Clifford+T 电路和门后去极化噪声实验。

  • 提交结构化 gates,仅支持 H、S、T、X、Y、Z、CX、CZ;CX/CZ 的 targets 顺序为控制位、目标位。量子位数、门数和 shots 由输入决定。maxActiveWidth 默认为 null;只有用户显式设置该预算时才按实际 peakActiveWidth 检查。
  • 初态固定为全零态;每个门后,在该门涉及的各量子位独立施加 DEPOLARIZE1(p)。p 是 Pauli 错误总概率,不是直接乘在密度矩阵上的白噪声混合系数。
  • 只做最终 Z 测量,位串从左到右为 q0、q1……。密度矩阵参考运行时返回完整位串(complete);跳过参考时仅返回实际出现的位串(observed_only),频数之和仍等于 shots。
  • referenceMode=auto|required|skip;独立密度矩阵参考默认在 6 qubits 内自动运行;required 尝试所请求规模;skip 主动跳过。未运行时 reference.status=not_run,参考概率、TVD、trace error 均为 null。密度矩阵参考描述相同的噪声模型;采样频数仍有有限 shots 不确定度。比较 total variation distance 时结合样本数,不要求频数与解析概率完全相等。
  • 该结构化接口不开放中间测量、反馈或 Stim 文本;需要记录采样时使用下述独立 Tool。
  • 当前 L1,scientificValidation=not_evaluated;依赖须显式准备;计算可能写本地缓存。

Stim 格式的纠错记录采样

调用同一连接的 clifft_local.sample_clifft_qec,提交 stimCircuit、shots、seed 和可选 maxActiveWidth、execution。

  • 接受文档列出的 Stim 指令子集及 T/T_DAG;支持 reset、REPEAT、DETECTOR、OBSERVABLE_INCLUDE,并已验证 CX rec[-1] 反馈。各门可用目标仍由固定后端检查,不承诺所有记录控制组合。
  • 返回每个 shot 的 measurements、detectors、observables 位串。测量按记录次序排列,detector 按声明次序排列,observable 按 ID 排列;不要按量子位编号重排中间记录。
  • detector/observable 是原始测量奇偶值,未减去理想参考。非零值不自动表示错误;没有生成 DEM、匹配权重或逻辑错误率。接解码器前必须另行定义参考与模型。
  • 仅 CPU 固定 shots;拒绝 LOSS、LEAKAGE、后选择和期望值记录。纯 Clifford 纠错存储与 MWPM 解码优先使用已有 QEC Tool。
  • 该路径没有独立科学 Validator,scientificValidation 仍为 not_evaluated。线路规模与资源设置由调用方选择,活跃宽度预算仅在显式设置时检查。

新接口的完整输入输出、允许指令与验证见互操作接入。

资源预算与实测规模见计算规模与参考检查。版本和数值验证见 接入说明。

Read the full file on GitHub · 45 lines

Files

What ships with it

6 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. 4d ago Changed · +11 lines 9d0cacee5cd1
  2. 22d ago Changed · +16 lines · +11 tokens per session c8c651c91660
  3. 1mo ago First seen · 18 lines · 39 tokens per session scan A 1d878be8446d

Subscribe to this mod's changes

clifft-sampling is a skill published in the GitHub repository xi-zhao/OpenQuantum (75 stars, last pushed yesterday), licensed MIT. It adds 50 tokens to every session and 1,156 once invoked, about $0.0002 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-09-15.

Related

Other skills, from other repositories

academic-research

Search academic papers, scholarly articles, and research publications through SandBase. Use when asked for literature review, academic citations, scholarly research, paper discovery, or scientific evidence gathering.

sandbaseai/sandbase-skills · 39 tokens

rhylthyme

Schedule multi-step procedures that a person carries out against a clock, with parallel tracks, shared equipment and steps that end when the person says so. Use when turning a lab protocol, recipe, event run sheet or workout into a timed plan; when several procedures must share one instrument (one centrifuge, one…

rhylthyme/rhylthyme-mcp · 167 tokens

memory-search-mcp

Long-term memory and context retrieval for AI agents. Semantic search across conversation history with care-weighted relevance.

CSOAI-ORG/memory-search-mcp · 0 tokens

gc-minimal-zine-poster-v0-3

Generate or analyze poetic paper-texture minimal zine posters with large negative space, a small editorial collage or focal element, experimental typography, and one clear color accent. Use when the user gives a theme, sentence, article, mood, object, photo, content brief, reference images, or an image folder and…

stvlynn/dsh.fish · 100 tokens

ask-sonner

Guide to Sonner, the React toast library — install and wire up the Toaster, pick the right toast() call, promise and loading toasts, updating, dismissing and persisting toasts, styling, theming and icons, positioning and multiple toasters. Use when working with Sonner or troubleshooting it — toasts that don't appear…

stvlynn/dsh.fish · 97 tokens

kill-ai-slop

Find and remove AI slop — the generic, machine-default visual and copy tics of vibe-coded products — from a web project. Use when the user asks to "kill AI slop", "de-slop", "remove the AI look", "make this not look AI-generated", or clean up a landing page / UI / docs that feels templated. Detects and fixes the…

stvlynn/dsh.fish · 249 tokens