mindquantum.core.gates.PhaseFlipChannel
- class mindquantum.core.gates.PhaseFlipChannel(p: float, **kwargs)[source]
A phase flip channel.
Phase flip channel express error that randomly flip the phase of qubit (applies Z gate) with probability \(P\), or do noting (applies I gate) with probability \(1-P\).
Phase flip channel applies noise as:
\[\epsilon(\rho) = (1 - P)\rho + P Z \rho Z\]where \(\rho\) is quantum state as density matrix type; \(P\) is the probability of applying an additional Z gate.
Examples
>>> from mindquantum.core.gates import PhaseFlipChannel >>> from mindquantum.core.circuit import Circuit >>> circ = Circuit() >>> circ += PhaseFlipChannel(0.02).on(0) >>> print(circ) ╔═════════════╗ q0: ──╢ PFC(p=1/50) ╟─── ╚═════════════╝