Real-Time Integration
○ Planned · Not yet implemented
The capabilities described on this page are planned and not yet implemented or released. They explain future design directions and should not be interpreted as delivered features.Stream kernels to a persistent QPU session for low-latency, feedback-driven workloads — the basis of real-time error correction and adaptive circuits.
Planned — not yet released
Planned interface / cloud · real-hardware integration. The open reference build runs only a local CPU simulator and does not provide live real-time QPU sessions.Why real-time?
Batch submission pays a round-trip per job. Real-time keeps a session open. Real-time feedback must happen on the controller close to the device; the Python client typically only submits a kernel containing conditional branches and does not participate in shot-by-shot feedback inside the coherence window.
Opening a session
import qalgora
# connect to a persistent execution session
session = qalgora.RemoteSession(target="gpu-mqpu", url="localhost:3030")
session.start()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.Mid-circuit measurement & feed-forward
from qalgora import h, x, z, mz
@qalgora.kernel
def teleport():
q = qalgora.qvector(3)
h(q[1])
x.ctrl(q[1], q[2]) # entangled pair
x.ctrl(q[0], q[1])
h(q[0])
b0 = mz(q[0]) # mid-circuit measurement
b1 = mz(q[1])
if b1: # conditioned on measurement
x(q[2])
if b0:
z(q[2])
How the conditionals run
The if here does not execute immediately on the Python host; at kernel compile time it is captured as device-side classical conditional control. This example only shows mid-circuit measurement and feed-forward — it does not include full state preparation or verification.Streaming many shots
for batch in range(1000):
result = session.submit(teleport) # low-latency session submission; exact latency is backend-dependent
handle_feedback(result)
session.stop()
Latency budget
Feed-forward must complete before decoherence. Keep classical control logic inside the kernel
(if on measured bits) so it runs on the controller, not over the network.
The documentation does not promise microsecond end-to-end round-trip latency from the Python client to the QPU.
实时集成
○ 规划中
本页所述能力属于规划功能,当前尚未发布或尚未实现。相关内容仅用于说明未来设计方向,不应理解为已交付能力。将内核流式提交至持久 QPU 会话,以支持低延迟、反馈驱动的工作负载——这是实时纠错与自适应线路的基础。
规划中·尚未发布
规划接口 / 云端·真机集成;参考实现仅本地 CPU 模拟,不含实时 QPU 会话。为何需要实时
批量提交每次作业都需要一次完整的网络往返。实时模式保持会话常开。实时反馈必须在靠近设备的控制器侧完成;Python 客户端通常只负责提交含条件分支的内核,不参与相干时间窗口内的逐次反馈。
开启会话
import qalgora
# connect to a persistent execution session
session = qalgora.RemoteSession(target="gpu-mqpu", url="localhost:3030")
session.start()规范接口 · 参考实现暂未包含
此示例展示的是 qalgora-Q 规范中的接口(或第三方库),开放参考实现目前尚未内置,仅用于说明预期用法;如需立即运行,请使用参考实现已支持的核心 API。线路中测量与前馈
from qalgora import h, x, z, mz
@qalgora.kernel
def teleport():
q = qalgora.qvector(3)
h(q[1])
x.ctrl(q[1], q[2]) # entangled pair
x.ctrl(q[0], q[1])
h(q[0])
b0 = mz(q[0]) # mid-circuit measurement
b1 = mz(q[1])
if b1: # conditioned on measurement
x(q[2])
if b0:
z(q[2])
if 如何执行
这里的 if 不在 Python 主机端立即执行,而是在 kernel 编译期被捕获为设备侧经典条件控制。该示例仅演示线路中测量与前馈,不包含完整的态制备与验证流程。流式多次执行
for batch in range(1000):
result = session.submit(teleport) # low-latency session submission; exact latency is backend-dependent
handle_feedback(result)
session.stop()
延迟预算
前馈操作必须在退相干发生前完成。将经典控制逻辑保留在内核内部(对测量结果使用 if 判断),使其在控制器本地运行,而非通过网络传输。文档不承诺 Python 客户端到 QPU 的微秒级端到端往返延迟。