mindquantum.core.gates.BitPhaseFlipChannel
- class mindquantum.core.gates.BitPhaseFlipChannel(p: float, **kwargs)[source]
A bit&phase flip channel.
Bit phase flip channel express error that randomly flip both the state and phase of qubit (applies \(Y\) gate) with probability \(P\), or do noting (applies \(I\) gate) with probability \(1-P\).
Bit phase flip channel applies noise as:
\[\epsilon(\rho) = (1 - P)\rho + P Y \rho Y\]where \(\rho\) is quantum state as density matrix type; \(P\) is the probability of applying an additional \(Y\) gate.
Examples
>>> 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) ╟─── ╚══════════════╝