qalgora-Q Docs Hub量子文档 ✦ Ask AI✦ 问问文档

Detector Error Models (规范接口 · 参考实现暂未包含)

◐ Design-level API
This page documents qalgora-Q API design, architecture, or adaptation workflows. Code examples illustrate intended usage and are not guaranteed to run in the current reference implementation.

A Detector Error Model (DEM) is a set of probabilistic error mechanisms: each mechanism fires with some probability and, when it fires, flips one or more detectors and may also flip a logical observable (a change of Pauli frame). Together they describe how physical noise turns into detector flips — the input a decoder needs for quantum error correction.

规范接口·参考实现暂未包含 — specification interface, not in the open reference build
Detector error models live in a quantum-error-correction / decoder workflow. The open reference implementation is a local CPU statevector simulator and ships no DEM extraction and no decoders, so the dem_from_kernel and qalgora_qec APIs below document the intended interface only — they will not run today.

Extracting a DEM from a kernel

import qalgora

# build a DEM directly from a noisy QEC circuit
dem = qalgora.dem_from_kernel(syndrome_circuit, noise_model=noise)
print(dem.num_detectors, dem.num_observables)
Specification API — not in the open reference build yet
This example shows a qalgora-Q specification API (or a third-party library) that the open reference build does not bundle today. It documents the intended interface; to run code now, use the reference build’s supported core API.

Using it with a decoder

import qalgora_qec as qec
decoder = qec.get_decoder("matching", dem)     # MWPM on the DEM graph
corrections = decoder.decode(detector_samples)
Specification API — not in the open reference build yet
This example shows a qalgora-Q specification API (or a third-party library) that the open reference build does not bundle today. It documents the intended interface; to run code now, use the reference build’s supported core API.
Limitations
A DEM is a good fit for noise that can be approximated as a graph of detector flips. Highly correlated or non-local errors break that graph assumption and may need a hypergraph decoder instead. Conceptually modeled on Stim's detector error model; unless stated otherwise, exact file-format / API / decoder-input compatibility is not guaranteed.

探测器错误模型 (规范接口 · 参考实现暂未包含)

◐ 设计接口
本页描述的是 qalgora-Q 的接口设计、架构设计或适配工作流。相关代码用于说明预期用法,当前参考实现不保证可以直接运行。

探测器错误模型(DEM)是一组带概率的错误机制:每个机制以一定概率发生,发生时翻转一个或多个探测器,并可能翻转一个逻辑可观测量(即改变 Pauli 参考系)。它们共同刻画物理噪声如何转化为探测器翻转——这正是量子纠错解码器所需的输入。

规范接口·参考实现暂未包含
探测器错误模型属于量子纠错 / 解码器工作流。开放参考实现是本地 CPU 态矢量模拟器,包含 DEM 提取,也包含任何解码器,因此下面的 dem_from_kernelqalgora_qec 接口仅用于说明预期用法,当前无法运行。

从内核中提取 DEM

import qalgora

# build a DEM directly from a noisy QEC circuit
dem = qalgora.dem_from_kernel(syndrome_circuit, noise_model=noise)
print(dem.num_detectors, dem.num_observables)
规范接口 · 参考实现暂未包含
此示例展示的是 qalgora-Q 规范中的接口(或第三方库),开放参考实现目前尚未内置,仅用于说明预期用法;如需立即运行,请使用参考实现已支持的核心 API。

与解码器配合使用

import qalgora_qec as qec
decoder = qec.get_decoder("matching", dem)     # MWPM on the DEM graph
corrections = decoder.decode(detector_samples)
规范接口 · 参考实现暂未包含
此示例展示的是 qalgora-Q 规范中的接口(或第三方库),开放参考实现目前尚未内置,仅用于说明预期用法;如需立即运行,请使用参考实现已支持的核心 API。
局限
DEM 适合可近似为探测器翻转图的错误。对于高度相关或非局域的错误,图假设不再成立,可能需要改用超图解码器。概念上参考 Stim 的 DEM;除非另有说明,不保证文件格式 / API / 解码器输入完全兼容。