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

Photonics Simulation

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

Beyond qubits, qalgora-Q documents photonic qudits — multi-level modes acted on by photonic operations like beam splitters and phase shifters.

Planned / specification — conceptual API only
Photonic support is a planned interface and is not in the open reference build. Photonic modes are not qubits and this is not the gate model — the snippets below use a conceptual qalgora.photonic.* API and are not runnable today.

Selecting the photonics target

import qalgora
# Conceptual API only; not in the open reference implementation.
# qalgora.set_target("photonics")

A photonic program

# Conceptual API only; not in the open reference implementation.
# Photonic modes are not qubits — this is not the gate model.
# @qalgora.kernel
# def hong_ou_mandel():
#     modes = qalgora.photonic.modes(2)        # two photonic modes (qudits, not qubits)
#     create(modes[0])                         # add a photon to each mode
#     create(modes[1])
#     beam_splitter(modes[0], modes[1])        # 50/50 beam splitter
#     # measure photon number in each mode
#
# # photons bunch: 02 / 20, never 11 (Hong–Ou–Mandel)
# print(qalgora.photonic.sample(hong_ou_mandel))
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.

Photonic operations

OperationAction
create / annihilateRaise / lower a mode's photon number
phase_shiftApply a phase to a mode
beam_splitterMix two modes

光子模拟

○ 规划中
本页所述能力属于规划功能,当前尚未发布或尚未实现。相关内容仅用于说明未来设计方向,不应理解为已交付能力。

除量子比特外,qalgora-Q 还记录了光子量子位元(qudit)——也就是多能级模式,并提供分束器、移相器等光子操作。

规划 / 规范接口 仅为概念性 API
光子支持属规划中接口,开放参考实现并未包含。光子模式不是量子比特,这也不是门模型——下面的片段使用概念性的 qalgora.photonic.* API,当前不可运行。

选择光子目标

import qalgora
# 仅为概念性 API 开放参考实现尚未包含。
# qalgora.set_target("photonics")

光子程序示例

# 仅为概念性 API 开放参考实现尚未包含。
# 光子模式不是量子比特 这也不是门模型。
# @qalgora.kernel
# def hong_ou_mandel():
#     modes = qalgora.photonic.modes(2)        # 两个光子模式(qudit,非量子比特)
#     create(modes[0])                         # 向每个模式注入一个光子
#     create(modes[1])
#     beam_splitter(modes[0], modes[1])        # 50/50 分束器
#     # 测量每个模式的光子数
#
# # 光子聚束:02 / 20,绝不出现 11(Hong–Ou–Mandel)
# print(qalgora.photonic.sample(hong_ou_mandel))
规范接口 · 参考实现暂未包含
此示例展示的是 qalgora-Q 规范中的接口(或第三方库),开放参考实现目前尚未内置,仅用于说明预期用法;如需立即运行,请使用参考实现已支持的核心 API。

光子操作一览

操作功能
create / annihilate升高 / 降低模式的光子数
phase_shift对模式施加相位
beam_splitter混合两个模式