Adapting Platform Algorithms
qalgora-Q plans to provide interop adapters for Qiskit, Cirq, Braket, PennyLane, pyQPanda, OpenQASM, Stim, and OpenFermion. The current open reference implementation does not yet bundle these adapters; this section shows the expected interfaces and migration approach.
Adapter map
| From | Import | Export |
|---|---|---|
| IBM Qiskit | from_qiskit() | to_qiskit() |
| Google Cirq | from_cirq() | to_cirq() |
| Amazon Braket | from_braket() | to_braket() |
| PennyLane | qalgora.qnode | to_pennylane() |
| Origin pyQPanda | from_qpanda() | to_qpanda() |
| OpenQASM 3 | from_qasm() | to_qasm() |
All adapters above are planned interfaces; the open reference implementation does not yet bundle them.
The common pattern
The from_*/to_* adapters below are planned interfaces;
the open reference implementation does not yet include them. The part that runs today is selecting a
local target and sampling native qalgora-Q kernels.
import qalgora
qalgora.set_target("qpp-cpu")
# optional: requires the qalgora-gpu plugin (planned)
# qalgora.set_target("gpu")
# Planned adapter workflow:
# kernel = qalgora.from_qiskit(qiskit_circuit)
# print(qalgora.sample(kernel, shots_count=1000))
# or hand a qalgora-Q kernel back to another framework (planned adapter):
# qiskit_circuit = qalgora.to_qiskit(my_kernel)跨平台算法适配
qalgora-Q 规划提供与 Qiskit、Cirq、Braket、PennyLane、pyQPanda、OpenQASM、Stim、OpenFermion 等的互操作适配器。当前开放参考实现尚未内置这些适配器;本节展示的是预期接口和迁移思路。
适配器一览
| 来源 | 导入 | 导出 |
|---|---|---|
| IBM Qiskit | from_qiskit() | to_qiskit() |
| Google Cirq | from_cirq() | to_cirq() |
| Amazon Braket | from_braket() | to_braket() |
| PennyLane | qalgora.qnode | to_pennylane() |
| Origin pyQPanda | from_qpanda() | to_qpanda() |
| OpenQASM 3 | from_qasm() | to_qasm() |
上述适配器均为规划接口,开放参考实现暂未内置。
通用模式
下方的 from_*/to_* 适配器为规划接口,开放参考实现暂未内置。当前可运行的部分是选择本地目标并对原生 qalgora-Q 内核采样。
import qalgora
qalgora.set_target("qpp-cpu")
# 可选:需安装 qalgora-gpu 插件(规划中)
# qalgora.set_target("gpu")
# 规划中的适配器工作流:
# kernel = qalgora.from_qiskit(qiskit_circuit)
# print(qalgora.sample(kernel, shots_count=1000))
# 或将 qalgora-Q 内核交回其他框架(规划中的适配器):
# qiskit_circuit = qalgora.to_qiskit(my_kernel)