∑ | Quantum Computing
Chapter 17 / 20

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

An initially prepared |+⟩ state under full computational-basis dephasing becomes I/2; it retains balanced Z probabilities but loses X-basis interference.

4. Reasoning flow

  1. Define the initial register and its basis states.
  2. Apply the transformations in their intended order.
  3. Track amplitude magnitudes and relative phases.
  4. Measure in the basis that reveals the desired property.
  5. 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 Python

5. 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.

◈ QuantumVerse Hub