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

Hands-On: Quantinuum

◐ 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.

Prepare a workflow for a Quantinuum H-Series trapped-ion system (this page uses H2-1), known for high quantum volume, mid-circuit measurement, and qubit reuse. Capabilities differ by access route and target (Nexus, Azure Quantum, Helios) — qubit count and quantum volume vary across the H-Series, so don't assume a single fixed figure.

1 · Access

Reach H-Series directly (Standard / Premium) or via Azure Quantum / Nexus. Set your token, then target the machine by name. Available qubit count and QV depend on the specific machine and route.

2 · A dynamic circuit (teleportation) — adapter workflow · planned

H-Series shines on circuits that measure mid-way and branch on the result. Validate the kernel locally first; the hardware submission is a planned adapter workflow:

import qalgora

@qalgora.kernel
def teleport():
    q = qalgora.qvector(3)
    ry(0.7, q[0])                 # state to send
    h(q[1]); x.ctrl(q[1], q[2])   # Bell pair
    x.ctrl(q[0], q[1]); h(q[0])
    b0 = mz(q[0]); b1 = mz(q[1])  # mid-circuit measurement
    if b1: x(q[2])
    if b0: z(q[2])
    mz(q[2])

qalgora.set_target("qpp-cpu")                              # reference implementation, local validation
print(qalgora.sample(teleport, shots_count=2000))
Specification interface / planned · not in the open reference build
Quantinuum submission is an adapter/export workflow requiring the vendor SDK and credentials. It is not part of the open CPU reference implementation. The line below is commented out to show the intended shape.
# qalgora.set_target("quantinuum", machine="H2-1")        # planned adapter — needs vendor SDK + credentials
# print(qalgora.sample_async(teleport, shots_count=2000).get())   # adapter future; blocks until the remote job finishes
Reference build runs locally — not real hardware
This example targets a remote cloud/QPU, but the open reference build does not submit to a real machine — it warns and falls back to the local CPU statevector simulator, returning simulated results. Submitting to an actual device (e.g. 天衍/TianYan, IBM, IonQ, Origin) requires the vendor’s own SDK and credentials.
On the adapter future
The job.get() / future semantics above are those of the adapter layer — it blocks until the remote job finishes. The open reference implementation does not produce a real remote job.

3 · Qubit reuse

A measured qubit can be reset and reused later in the same circuit, stretching the effective width — valuable when physical qubits are a scarce resource.

4 · What it's great for

Tips
H2-class systems have reported high quantum volume and tolerate deeper circuits than most, but the exact qubit count and QV vary by machine and access route (Nexus / Azure / Helios) — check the current specs rather than assuming one figure. Validate on qpp-cpu first; H-Series time is premium.

实战:Quantinuum

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

为 Quantinuum H-Series 离子阱系统准备工作流(本页以 H2-1 为例),其以高量子体积、线路中测量与量子比特复用著称。能力随接入方式与目标(Nexus、Azure Quantum、Helios)而不同——H-Series 各机型的量子比特数与量子体积各异,请勿假设单一固定数值。

1 · 访问方式

可直接访问 H-Series(标准版 / 付费版),也可通过 Azure Quantum / Nexus 接入。设置令牌后,按名称指定目标机器。可用量子比特数与量子体积取决于具体机型与接入方式。

2 · 动态电路(隐形传态)——适配器工作流·规划中

H-Series 在线路中测量并根据结果进行分支的场景下表现尤为出色。先在本地验证内核;真机提交是规划中的适配器工作流:

import qalgora

@qalgora.kernel
def teleport():
    q = qalgora.qvector(3)
    ry(0.7, q[0])                 # state to send
    h(q[1]); x.ctrl(q[1], q[2])   # Bell pair
    x.ctrl(q[0], q[1]); h(q[0])
    b0 = mz(q[0]); b1 = mz(q[1])  # mid-circuit measurement
    if b1: x(q[2])
    if b0: z(q[2])
    mz(q[2])

qalgora.set_target("qpp-cpu")                              # 参考实现本地验证
print(qalgora.sample(teleport, shots_count=2000))
规范接口/规划中 · 参考实现暂未包含
Quantinuum 提交属于适配器/导出工作流,需厂商 SDK 与凭据;开源 CPU 参考实现暂未包含。下方代码已注释,仅示意预期形态。
# qalgora.set_target("quantinuum", machine="H2-1")        # 规划中 / 适配示意:需厂商 SDK 与凭据
# print(qalgora.sample_async(teleport, shots_count=2000).get())   # 适配器 future;阻塞直到远程任务完成
参考实现仅本地运行 · 非真机
此示例虽指向远程云端/QPU,但开放参考实现不会真正提交到真机 —— 它会给出告警并回退到本地 CPU 态矢量模拟器,返回模拟结果,不会真正提交到天衍等真机。真正提交真机需使用对应厂商的 SDK 与凭证。
关于适配器 future
上面的 job.get() / future 语义属于适配器层——它会阻塞直到远程任务完成;开放参考实现不会产生真实远程 job。

3 · 量子比特复用

已测量的量子比特可在同一线路中被重置并再次使用,从而扩展有效宽度——在物理量子比特稀缺时尤为宝贵。

4 · 它擅长什么

  • 动态电路与自适应算法。
  • 实时纠错实验。
  • 深度、高保真度线路(双比特门保真度 99.9% 以上)。
小贴士
H2 级系统已报告较高的量子体积,可承受比大多数系统更深的线路,但确切的量子比特数与量子体积因机型与接入方式(Nexus / Azure / Helios)而异——请查阅当前规格而非假设单一数值。建议先在 qpp-cpu 上验证;H-Series 机时属于付费资源。