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