Backends & Simulators
Select a target to choose where kernels execute — from CPU simulators to GPU statevector engines to physical QPUs.
Simulator targets
| Target | Description | Reference-build status |
|---|---|---|
qpp-cpu | CPU statevector simulator (default) | Available in reference build |
density-matrix-cpu | Noisy simulation with density matrices | Available in reference build |
gpu | Single-GPU statevector simulator | Planned |
gpu-mqpu | Multi-GPU / multi-QPU distribution | Planned |
tensornet | Tensor-network simulator for large, low-entanglement circuits | Planned |
tensornet-mps | Matrix-product-state simulator for 1D / low-entanglement circuits | Planned |
stim | Clifford / stabilizer simulator (QEC) | Planned |
photonics | Qudit / photonic operations | Planned |
cpu is an alias of qpp-cpu.
Selecting a target
Only qpp-cpu (and its cpu alias) and density-matrix-cpu run on the
open reference build today; the GPU and tensor-network targets below are the specified interface and are
not included yet.
import qalgora
qalgora.set_target("qpp-cpu") # runnable today; "cpu" is an alias
counts = qalgora.sample(kernel)
# Planned backends (spec interface — not in the open reference build):
# qalgora.set_target("gpu")
# counts = qalgora.sample(kernel, target="tensornet")
Hardware QPUs
qalgora-Q documents vendor-SDK-mediated workflows for the same kernel on physical quantum hardware via cloud providers — the target name selects the vendor and device. The open reference build does not natively submit to a real QPU; it runs locally and falls back to the CPU simulator. Real execution requires the vendor SDK and credentials, supplied through environment variables.
# Planned adapter — real-QPU submission needs the vendor SDK and credentials:
# qalgora.set_target("quantinuum", machine="H2-1")
# qalgora.set_target("ionq")
# qalgora.set_target("iqm", qpu="Adonis")后端与模拟器
选择目标后端来决定内核的执行位置——从 CPU 模拟器、GPU 态矢量引擎,到实体 QPU。
模拟器目标后端
| 目标后端 | 说明 | 当前参考实现状态 |
|---|---|---|
qpp-cpu | CPU 态矢量模拟器(默认) | 参考实现可用 |
density-matrix-cpu | 基于密度矩阵的噪声模拟 | 参考实现可用 |
gpu | 单 GPU 态矢量模拟器 | 规划中 |
gpu-mqpu | 多 GPU / 多 QPU 分布式执行 | 规划中 |
tensornet | 适用于大规模低纠缠线路的张量网络模拟器 | 规划中 |
tensornet-mps | 面向一维 / 低纠缠线路的矩阵乘积态模拟器 | 规划中 |
stim | Clifford / 稳定子模拟器(QEC) | 规划中 |
photonics | 多能级量子位(qudit)与光子操作 | 规划中 |
cpu 是 qpp-cpu 的别名。
选择目标后端
当前只有 qpp-cpu(及其 cpu 别名)与 density-matrix-cpu 能在开放参考实现上运行;下面的 GPU 与张量网络目标属于规范接口,参考实现暂未包含。
import qalgora
qalgora.set_target("qpp-cpu") # 当前可运行;"cpu" 是其别名
counts = qalgora.sample(kernel)
# 规划中后端(规范接口——参考实现暂未包含):
# qalgora.set_target("gpu")
# counts = qalgora.sample(kernel, target="tensornet")
硬件 QPU
qalgora-Q 记录的是经厂商 SDK 中介的工作流——目标后端名称用于指定厂商和设备,凭据通过环境变量传入。开放参考实现不会原生提交真机,而是在本地运行并回退到 CPU 模拟器;真机执行需厂商 SDK 与凭证。
# 规划中适配:真实 QPU 提交需厂商 SDK 与凭据
# qalgora.set_target("quantinuum", machine="H2-1")
# qalgora.set_target("ionq")
# qalgora.set_target("iqm", qpu="Adonis")