Steven GellerQuantum Computing, End to End

Book contents

Current section

Part V. Practical Software

  1. Python and Quantum Programming Workflow
  2. Building a Small Simulator From Scratch
  3. Qiskit, Primitives, and Circuit Execution
  4. Cirq and Alternative Toolchains
  5. Transpilation and Hardware-Aware Compilation
  6. Noise Models and Noisy Simulation
  7. Benchmarking Quantum Programs
  8. Resource Estimation for Fault-Tolerant Algorithms
  9. Reproducible Quantum Labs

Part V. Practical Software · Chapter 41

Noise Models and Noisy Simulation

An ideal simulator tells you what your circuit means; a noisy one tells you what it might survive. This chapter gives you the handful of noise models worth knowing and the diagnosis habit that turns strange counts into evidence instead of shrugs.

Lab
In this chapter 11 sections

Implement each channel as a trace-preserving map on a declared density matrix, choose preparations and measurement bases that make its signature observable, separate exact channel output from sampled counts, and label every parameter as pedagogical or calibrated.

Noise diagnosis is an experimental-design problem. A channel may change an off-diagonal matrix element while leaving the computational-basis histogram untouched; the simulator must preserve that distinction instead of producing one generic “noise strength” slider.

Quantum channel followed by measurement and readout confusionρ inputquantumchannelmeasurementclassicalconfusion
Figure 41.1. Readout confusion acts on classical outcome probabilities. Moving it into the channel changes the physical question and can hide a basis-dependent diagnosis.

A noise model is a map with a declared domain

The teaching domain is a 2×22\times2 density matrix ρ\rho: Hermitian, positive semidefinite, trace one. A physical quantum channel must be trace preserving and completely positive [Nielsen and Chuang]. These conditions prevent a simulator from emitting negative probabilities or changing total probability while still drawing an attractive plot.

The bit-flip channel is Ep(ρ)=(1p)ρ+pXρX\mathcal E_p(\rho)=(1-p)\rho+pX\rho X, with dimensionless p per channel application. This is a pedagogical Pauli channel, not a named device mechanism. Decoherence models are useful only when their assumptions remain visible [Preskill notes]. The Lindblad and Gorini–Kossakowski–Sudarshan results characterize generators of continuous-time Markovian completely positive dynamical semigroups; citing them does not make every processor’s noise Markovian [Lindblad] [Gorini, Kossakowski, and Sudarshan].

The Kraus form makes the validity check executable. Set K0=1pIK_0=\sqrt{1-p}I and K1=pXK_1=\sqrt p X, then compute Ep(ρ)=kKkρKk\mathcal E_p(\rho)=\sum_k K_k\rho K_k^\dagger. The completeness relation kKkKk=I\sum_k K_k^\dagger K_k=I proves trace preservation for 0p10\le p\le1; the operator-sum construction supplies complete positivity. Reject p outside that interval rather than clipping it. Clipping conceals a caller error and changes a supposedly recorded experiment.

Test positivity with eigenvalues, not diagonal entries alone. A Hermitian matrix can have nonnegative diagonal elements and still possess a negative eigenvalue because its coherence is too large. For a 2×22\times2 state, checking trace, Hermiticity, and both eigenvalues to a declared numerical tolerance is inexpensive. The tolerance belongs to floating-point validation; it is not permission to accept a materially unphysical state.

Bit flips move populations

Apply the channel to 0 ⁣0\lvert0\rangle\!\langle0\rvert. The result is diagonal: population 1−p on 0\lvert 0 \rangle and p on 1\lvert 1 \rangle. A Z-basis measurement sees it directly. At p=0, recover the input; at p=1, recover 1\lvert 1 \rangle; at p=0.1, exact probabilities are 0.9 and 0.1. Assert trace one, Hermiticity, nonnegative diagonal probabilities, and analytic entries at tolerance 10−12.

On an arbitrary state ρ=[acc1a]\rho=\begin{bmatrix}a&c\\c^*&1-a\end{bmatrix}, the bit-flip channel gives diagonal entry a=(1p)a+p(1a)a'= (1-p)a+p(1-a) and exchanges the off-diagonal elements inside the weighted sum. At p=1/2, populations become equal for every input, but coherence need not vanish. This is why “bit flip at fifty percent” is not the completely depolarizing channel: some X-axis information survives.

Use 0\lvert 0 \rangle and +\lvert + \rangle as complementary probes. The first exposes population transfer in Z. The second is an +1 eigenstate of X, so an X error changes it only by the same state and the X-basis outcome remains deterministic. A diagnostic that reports identical degradation for both probes has likely implemented a depolarizing shortcut instead of the declared bit-flip map.

Dephasing hides until the basis changes

For + ⁣+\lvert+\rangle\!\langle+\rvert, computational-basis populations begin at one half and stay there under dephasing. The off-diagonal coherence shrinks. A Z histogram therefore cannot distinguish ideal +\lvert + \rangle from a fully dephased mixture. Rotate with H and measure Z—equivalently measure X—and the lost coherence becomes a changed outcome probability.

This is why “we measured the same bit distribution” is not a channel-validation claim. State preparation and measurement basis decide which channel signature is identifiable.

The fixture uses the phase-flip convention Zp(ρ)=(1p)ρ+pZρZ\mathcal Z_p(\rho)=(1-p)\rho+pZ\rho Z. For +\lvert + \rangle, the coherence is multiplied by 12p1-2p, and the X-basis minus probability is p. At p=1/2 the state is fully dephased; at p=1 the state is \lvert - \rangle, which is coherent rather than mixed. Calling p=1 “maximum dephasing” would therefore be wrong under this parameterization.

A phase-damping model is often parameterized so coherence decays monotonically toward zero instead. The two channels may coincide at selected parameter values but their parameters do not share a universal meaning. Store the channel name, Kraus operators or defining equation, application scope, and parameter convention. A bare field named dephasing: 0.1 is not reproducible.

The two-basis diagnosis is now analytic. With p=0.1 and +\lvert + \rangle input, Z probabilities remain (0.5,0.5), while after H the Z probability of one is 0.1. For a bit-flip channel on 0\lvert 0 \rangle, Z probability of one is 0.1, while an X measurement is balanced. The same decimal produces different pairs of signatures; the pair, not the decimal, identifies the implemented mechanism.

Shot noise and channel noise leave different records

The exact post-channel matrix and probabilities belong in one record. Sampled counts, shots, pseudorandom generator, seed, and acceptance interval belong in another. Increasing shots narrows sampling uncertainty; it does not remove channel error. Conversely, setting p=0 does not force a finite sample to contain exact expected proportions. Hardware benchmark interpretation must separate sampling, preparation, gate, and measurement contributions [benchmarking review]; randomized benchmarking supports its own bounded decay-model claim rather than a general application claim [Magesan, Gambetta, and Emerson].

For a binary measurement with exact probability q and n independent shots, the count variance is nq(1q)nq(1-q); the frequency standard deviation is q(1q)/n\sqrt{q(1-q)/n}. At q=0.1 and n=1,000, that standard deviation is about 0.0095. A frequency of 0.112 may be ordinary shot variation even though it differs from the exact channel output. The acceptance rule must be chosen before seeing the count and must state whether a normal approximation, exact interval, or hypothesis test is used.

Repeat seeds do not provide independent experimental replicates if every other simulated input is identical, and more simulated shots cannot establish that a toy channel matches hardware. They estimate the sampler wrapped around the chosen model. Report exact-model error separately from Monte Carlo error so that a reader can see which one additional computation can reduce.

Channel signature and readout-confusion notebook-free lab

Diagnostic signatures at p=0.1
inputmechanismZ-basis Pr(1)X-basis Pr(−)
0\lvert 0 \ranglebit flip0.10.5
+\lvert + \rangledephasing0.50.1 under phase-flip convention
measured bit5% symmetric confusion0.05+0.90papplied after basis measurement
def bit_flip_zero(p): return ((1-p, 0.0), (0.0, p))
def dephase_plus(p): return ((0.5, 0.5*(1-2*p)), (0.5*(1-2*p), 0.5))
def trace(rho): return rho[0][0] + rho[1][1]
def x_minus_probability(rho): return 0.5*(1 - 2*rho[0][1])
def readout_confuse(p_one, e=.05): return e*(1-p_one) + (1-e)*p_one
rho_x = bit_flip_zero(.1); rho_z = dephase_plus(.1)
identity_case = bit_flip_zero(0.0); complete_dephase = dephase_plus(0.5)
assert abs(trace(rho_x)-1) < 1e-12 and abs(trace(rho_z)-1) < 1e-12
assert abs(rho_x[1][1]-.1) < 1e-12
assert abs(x_minus_probability(rho_z)-.1) < 1e-12
assert abs(readout_confuse(.1)-.14) < 1e-12
assert identity_case == ((1.0, 0.0), (0.0, 0.0)) and complete_dephase[0][1] == 0.0
print(f"PASS: 41 noise bitflip_population={rho_x[1][1]:.3f} dephase_coherence={rho_z[0][1]:.3f} complete_dephase={complete_dephase[0][1]:.1f}")

Existing check: cd labs && python -m unittest tests.test_companion_models.CompanionModelTests.test_bit_flip_and_dephasing_channels -v.

Readout confusion belongs after the state

A symmetric confusion matrix flips the reported classical bit with probability e. If the true probability of one is q, the reported probability is e(1−q)+(1−e)q. The matrix acts after the chosen quantum measurement. Treating it as decoherence would incorrectly make it change with preparation basis and would prevent separate calibration.

Official SDK simulators expose model-specific configurations, not a universal hardware truth [Qiskit noise documentation] [Cirq noise documentation]. Preserve whether a configured error is a channel, gate attachment, or readout model.

For asymmetric readout, write M=[1e01e10e011e10]M=\begin{bmatrix}1-e_{0\to1}&e_{1\to0}\\e_{0\to1}&1-e_{1\to0}\end{bmatrix} acting on the true probability column. Each column sums to one. Calibrate the two error directions separately using prepared 0\lvert 0 \rangle and 1\lvert 1 \rangle. Symmetry is a simplifying assumption, not a property to infer from one average percentage.

Inverting M can estimate pre-readout probabilities when the matrix is known and well conditioned, but inversion amplifies calibration and sampling error. It may produce negative components. Keep the raw counts, calibration record, inversion method, and uncertainty; never replace observations with clipped corrected values. Mitigation changes the estimator and its variance, not the underlying state.

Calibrated claims need more than p

A device claim needs channel scope, gate dependence, qubit pair, timing, leakage policy, correlations, crosstalk, drift, timestamp, calibration protocol, and uncertainty. One-qubit stationary channels omit non-Markovian behavior and context. Label the artifact’s p values “teaching parameters.” Calibration-like decimal places do not make them calibrated.

Composition order can matter. A coherent rotation followed by dephasing need not equal dephasing followed by that rotation, and a gate-attached channel is applied a different number of times after transpilation changes. Record the compiled operation trace and the precise insertion rule: before gate, after gate, per duration, or once per idle interval. Otherwise two simulators can accept the same parameter file and implement different processes.

Finally, validate the simulator against limiting cases and composition identities before fitting anything. Identity at p=0, X conjugation at p=1, complete phase loss at the convention’s p=1/2, trace preservation after repeated applications, and agreement between explicit matrices and Kraus evaluation are stronger evidence than a smooth noise curve. Smoothness is easy to generate; the declared channel algebra is the contract.

Channel order should be an explicit test case. Apply dephasing to +\lvert + \rangle, rotate with H, then add readout confusion; compare that with the deliberately wrong implementation that confuses labels before the H. The first path changes a classical distribution only after a quantum basis choice. The second effectively defines a different quantum experiment. Their disagreement is the evidence that the simulator has preserved layer boundaries rather than collapsing every imperfection into one probability.

For each mechanism, store an identifiability statement: which inputs and observables respond, which remain unchanged, and which alternative channel shares that signature. Bit-flip p=0.1 on 0\lvert 0 \rangle is visible in Z; phase flip p=0.1 on +\lvert + \rangle is visible in X; symmetric readout affects both after measurement. A model library without this table encourages parameter fitting to non-identifying data.

A final fixture composes each channel twice and compares the result with the analytic effective parameter. This catches implementations that mutate the input matrix, apply the channel once per matrix entry, or renormalize after every step. Composition tests the map as an operation, not merely one attractive endpoint.

Mechanism separation

Prompt: Choose an input state and two measurement bases that distinguish bit-flip probability 0.1 from dephasing probability 0.1, then add five-percent symmetric readout confusion.

Deliverable: Analytic density matrices, simulator output, sampled records with seed/shots, and a diagnosis table for the three mechanisms.

Pass condition: Trace remains one, matrices stay Hermitian, the chosen bases separate channel signatures, and readout error is applied only after quantum measurement probabilities.

Reference diagnostics

Format: Reference matrices, CSV outputs, and diagnosis table with tolerance and confidence rules.

Verification: Tests compare matrix entries to analytic values at 1e-12 and sampled proportions to precomputed binomial acceptance intervals.

Use |0> with Z measurement to reveal bit flips and |+> with X measurement to reveal dephasing. Both exact matrices retain trace one and Hermiticity. The five-percent confusion matrix then acts on each already-computed measurement distribution, so its effect remains separable from channel evolution.

Companion work

Artifacts for this chapter

These entries resolve to checked-in local source. Commands are reproduced exactly from the chapter manifest, and source-embedded fixtures are exported as direct downloads.

  1. Reproduce or test

    python3 tools/validate_briefs.py --briefs data/editorial_briefs_36_63.json --from 36 --through 63 --check-rewritten-sources --execute-artifacts

Provenance

Sources and review

  1. Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum Information. Cambridge University Press. 2010textbook
  2. Göran Lindblad. On the generators of quantum dynamical semigroups. Communications in Mathematical Physics. 1976primary peer-reviewed theory paper
  3. Vittorio Gorini, Andrzej Kossakowski, and E. C. G. Sudarshan. Completely positive dynamical semigroups of N-level systems. Journal of Mathematical Physics. 1976primary peer-reviewed theory paper
  4. John Preskill. Lecture Notes for Physics 219: Quantum Computation. California Institute of Technology. 2018graduate lecture notes
  5. IBM Quantum. Qiskit documentation. IBM. 2026official documentation
  6. Google Quantum AI. Cirq documentation. Google. 2026official documentation
  7. Timothy Proctor et al.. Benchmarking quantum computers. Nature Reviews Physics. 2025peer-reviewed perspective
  8. Easwar Magesan, J. M. Gambetta, and Joseph Emerson. Scalable and robust randomized benchmarking of quantum processes. Physical Review Letters. 2011primary paper

The load-bearing claims in the chapter are mapped inline to this registered source set. A citation supports only the bounded claim beside it.

Cite this chapter