mindquantum.core.gates.BitPhaseFlipChannel
- class mindquantum.core.gates.BitPhaseFlipChannel(p: float, **kwargs)[源代码]
比特相位翻转信道。描述的噪声体现为:以
的概率翻转比特的量子态和相位(作用 门),或以 的概率保持不变(作用 门)。比特相位翻转通道的数学表示如下:
其中,
是密度矩阵形式的量子态; 是作用额外 门的概率。- 参数:
p (int, float) - 发生错误的概率。
样例:
>>> from mindquantum.core.gates import BitPhaseFlipChannel >>> from mindquantum.core.circuit import Circuit >>> circ = Circuit() >>> circ += BitPhaseFlipChannel(0.02).on(0) >>> print(circ) ╔══════════════╗ q0: ──╢ BPFC(p=1/50) ╟─── ╚══════════════╝