When a qubit travels through a real device it may be accidentally flipped by the
environment. The bit-flip channel captures this mathematically: with probability
p the Pauli-X gate acts on the qubit, and with probability 1−p nothing happens.
Density matrices for mixed states
A pure state ∣ψ⟩ is described by a ket. A probabilistic mixture requires a
density matrix
ρ=i∑pi∣ψi⟩⟨ψi∣,i∑pi=1,pi≥0.
The 2×2 density matrix of a single qubit is Hermitian, positive semi-definite,
and has unit trace. Pure states satisfy ρ2=ρ; mixed states satisfy
tr(ρ2)<1.
Kraus representation
A quantum channel (a completely positive, trace-preserving map) can always be written
in the Kraus form
E(ρ)=k∑KkρKk†,k∑Kk†Kk=I.
The bit-flip channel has two Kraus operators
K0=1−pI,K1=pX.
You can verify the completeness relation:
K0†K0+K1†K1=(1−p)I+pI=I. The channel is therefore
trace-preserving for any p∈[0,1].
Applying the channel to ∣0⟩
Start with the pure state ρin=∣0⟩⟨0∣. Plugging into
the Kraus sum:
Before the channel the state is pure: tr(ρin2)=1. After it
tr(ρout2)=(1−p)2+p2=1−2p(1−p).
This is strictly less than 1 for 0<p<1, confirming that noise has turned the
pure state into a mixed state. The purity is minimised at p=1/2, where it equals
1/2.
Try it
The bit-flip channel with p=0.3 is applied to ∣0⟩. Compute the probability
of measuring ∣1⟩ and return it.
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.