|q⟩ Bad Qubits

intermediate · Programming · Noise, Decoherence & Density-Matrix Simulation

Depolarizing Noise

Real quantum hardware never executes a gate perfectly. One of the most widely studied noise models is the depolarizing channel, which blends a target state with the maximally mixed state I/2I/2. It captures the combined effect of random bit flips, phase flips, and simultaneous flip-and-phase errors.

The channel and its Kraus decomposition

For a single qubit with error rate p[0,1]p \in [0, 1], the depolarizing channel acts on a density matrix ρ\rho as

E(ρ)=(1p)ρ+p3(XρX+YρY+ZρZ).\mathcal{E}(\rho) = (1-p)\,\rho + \frac{p}{3}\bigl(X\rho X + Y\rho Y + Z\rho Z\bigr).

The four terms can be read off immediately: with probability 1p1-p nothing happens; with probability p/3p/3 each, an XX, YY, or ZZ error is applied. The four operators

K0=1pI,K1=p/3X,K2=p/3Y,K3=p/3ZK_0 = \sqrt{1-p}\,I,\quad K_1 = \sqrt{p/3}\,X,\quad K_2 = \sqrt{p/3}\,Y,\quad K_3 = \sqrt{p/3}\,Z

are the Kraus operators of the channel. They satisfy the completeness relation kKkKk=I\sum_k K_k^\dagger K_k = I, guaranteeing that the channel is trace-preserving.

Effect on measurement probabilities

Starting from the pure state 00|0\rangle\langle 0| and applying the depolarizing channel with rate pp, the resulting density matrix is

E(00)=(1p)00+p3(11+11+00)=(12p3)00+2p311.\mathcal{E}\bigl(|0\rangle\langle 0|\bigr) = (1-p)|0\rangle\langle 0| + \frac{p}{3}\bigl(|1\rangle\langle 1| + |1\rangle\langle 1| + |0\rangle\langle 0|\bigr) = \left(1 - \frac{2p}{3}\right)|0\rangle\langle 0| + \frac{2p}{3}\,|1\rangle\langle 1|.

Spelling out the arithmetic: X0=1X|0\rangle = |1\rangle, Y0=i1Y|0\rangle = i|1\rangle, and Z0=0Z|0\rangle = |0\rangle, so only the ZZ error leaves the state in 00|0\rangle\langle 0| while both XX and YY errors rotate it to 11|1\rangle\langle 1|. The probability of measuring 00 is therefore

P(0)=0E(00)0=12p3.P(0) = \langle 0|\mathcal{E}(|0\rangle\langle 0|)|0\rangle = 1 - \frac{2p}{3}.

At p=0p = 0 (no noise) this gives P(0)=1P(0) = 1, as expected. At p=3/4p = 3/4 it gives P(0)=1/2P(0) = 1/2 — the outcome is a fair coin flip, identical to what you would get from the maximally mixed state. For p=1p = 1 the formula gives P(0)=1/3P(0) = 1/3, consistent with the XX and YY errors each contributing 1/31/3 probability of ending in 1|1\rangle.

Bloch-sphere picture

On the Bloch sphere the depolarizing channel is an isotropic contraction toward the origin. The Bloch vector r\vec{r} shrinks by the factor (14p/3)(1 - 4p/3):

r    (14p3)r.\vec{r} \;\longmapsto\; \left(1 - \frac{4p}{3}\right)\vec{r}.

At p=3/4p = 3/4 the Bloch vector vanishes entirely, confirming the maximally mixed state. This contraction is symmetric in all three directions, which is why the channel is called depolarizing — it removes polarization uniformly.

Try it

The depolarizing channel with p=3/4p = 3/4 is applied to 0|0\rangle. Using the formula P(0)=12p/3P(0) = 1 - 2p/3, compute and return the probability of measuring 0|0\rangle.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.