mindquantum.core.gates.DepolarizingChannel
- class mindquantum.core.gates.DepolarizingChannel(p: float, n_qubits: int = 1, **kwargs)[source]
A depolarizing channel.
Depolarizing channel express errors that have probability
to turn qubit's quantum state into maximally mixed state, by randomly applying one of the pauli gate(I,X,Y,Z) with same probability . And it has probability to change nothing.In one qubit case, depolarizing channel applies noise as:
where
is quantum state as density matrix type; is the probability of occurred the depolarizing error.This channel supports many object qubits. In
qubit case, depolarizing channel applies noise as:where
is the number of object qubits; is many qubit pauli operator.For
case, this channel is a depolarizing channel, and it becomes a completely depolarizing channel when .However,
is also an available case, but not a depolarizing channel any more. When it becomes a uniform Pauli error channel: , where .
- Parameters
Examples
>>> from mindquantum.core.gates import DepolarizingChannel >>> from mindquantum.core.circuit import Circuit >>> circ = Circuit() >>> circ += DepolarizingChannel(0.02).on(0) >>> circ += DepolarizingChannel(0.01, 2).on([0, 1]) >>> print(circ) ╔════════════╗ ╔═════════════╗ q0: ──╢ DC(p=1/50) ╟─╢ ╟─── ╚════════════╝ ║ ║ ║ DC(p=1/100) ║ q1: ─────────────────╢ ╟─── ╚═════════════╝