Noise Learning
◐ 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.Before you can cancel noise, you have to measure it. Noise learning characterizes a device's error channels into a model that error mitigation (especially PEC) consumes.
Learning a noise model
import qalgora
# Planned adapter — learning a noise model from a real device needs vendor SDK/credentials:
# qalgora.set_target("ibm", machine="ibm_torino")
# learn a sparse Pauli-Lindblad model for the layers in this kernel
model = qalgora.noise_learner(my_kernel, max_layers=8).run()
print("learned layer fidelity:", model.layer_fidelity())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.Model assumptions
This model typically assumes the noise can be approximated as a local, sparse, Markovian
Pauli-Lindblad channel; for strongly non-Markovian or crosstalk-dominated noise, the fitted
model may be inadequate.
Feeding mitigation
# PEC inverts the learned model to cancel noise in expectation values
energy = qalgora.observe(my_kernel, hamiltonian,
resilience_level=3, noise_model=model).expectation()
Why separate it?
Learning is expensive but reusable: characterize once, then apply the model across many
mitigated runs on the same device layers.
噪声学习
◐ 设计接口
本页描述的是 qalgora-Q 的接口设计、架构设计或适配工作流。相关代码用于说明预期用法,当前参考实现不保证可以直接运行。要消除噪声,先得测出噪声。噪声学习把设备的误差信道刻画成一个噪声模型,供误差缓解(尤其是 PEC)使用。
学习噪声模型
import qalgora
# 规划中适配:从真机学习噪声模型需厂商 SDK 与凭据
# qalgora.set_target("ibm", machine="ibm_torino")
# 为这个内核中的各层学习一个稀疏 Pauli-Lindblad 噪声模型
model = qalgora.noise_learner(my_kernel, max_layers=8).run()
print("learned layer fidelity:", model.layer_fidelity())规范接口 · 参考实现暂未包含
此示例展示的是 qalgora-Q 规范中的接口(或第三方库),开放参考实现目前尚未内置,仅用于说明预期用法;如需立即运行,请使用参考实现已支持的核心 API。模型假设
该模型通常假设噪声可近似为局域、稀疏、Markovian 的 Pauli-Lindblad 形式;对强非马尔可夫或串扰噪声,拟合模型可能不充分。
用于误差缓解
# PEC inverts the learned model to cancel noise in expectation values
energy = qalgora.observe(my_kernel, hamiltonian,
resilience_level=3, noise_model=model).expectation()
为何要单独学习
学习过程开销不小,好在结果可以反复用:表征一次,就能把这个模型套到同一批设备层上的多次误差缓解里。