Quantum noise and density matrices
Model open systems beyond ideal state vectors.
1. Core idea
A density matrix describes pure and mixed states. Noise acts through quantum channels rather than necessarily through one unitary matrix. Dephasing suppresses off-diagonal coherence, while amplitude damping models energy relaxation. Real hardware introduces finite gate fidelity and measurement errors.
2. Mathematical foundation
The notation describes a precise relationship among states, transformations or probabilities. Identify each symbol, check the dimensions of the objects, and distinguish amplitudes from the probabilities produced by a measurement.
3. Worked example
4. Reasoning flow
- Define the initial register and its basis states.
- Apply the transformations in their intended order.
- Track amplitude magnitudes and relative phases.
- Measure in the basis that reveals the desired property.
- Interpret the result and check the resource assumptions.
Qiskit implementation
Run this standalone Python script with Qiskit installed. It uses exact statevector simulation rather than noisy hardware shots.
import numpy as np
from qiskit.quantum_info import DensityMatrix, Statevector, purity
qc_state = Statevector.from_label('+')
rho_pure = DensityMatrix(qc_state)
rho_dephased = DensityMatrix(np.eye(2) / 2)
print('Pure state purity:', purity(rho_pure))
print('Fully dephased purity:', purity(rho_dephased))
# Expected: 1.0 and 0.5
Download runnable Python5. Check your understanding
Practice question
Compute Tr(ρ²) for |+⟩⟨+| and I/2.
6. What to watch out for
Ideal-state calculations assume perfect gates and measurements. When assessing an algorithm, separate its mathematical guarantee from the cost of building oracles, preparing inputs, repeating experiments and correcting physical noise.