Noise Simulation
Noise simulation predicts how an imperfect quantum process changes states and measurement outcomes. A density matrix follows the averaged state directly; stochastic trajectories follow randomly selected pure-state branches and recover that average over many runs. Both can represent the same model, but they spend memory and computation differently.
The model and the numerical method answer separate questions. Accurately solving an independent-error model does not make it describe a device with slow drift or correlated faults. This page explains how to propagate noisy circuits, preserve their measurements and correlations, and distinguish sampling uncertainty from numerical and model error.
Helpful background. Quantum circuit simulation introduces state evolution and measurement branches. Noise in quantum information describes the physical mechanisms; Kraus representations explains completely positive maps and their operator sums.
Channels acting on a circuit
Section titled “Channels acting on a circuit”For a Markovian circuit model, an ideal gate and its associated noise might act as
This explicitly places the noise after the gate. Reversing their order generally changes the answer. For example, amplitude damping leaves unchanged. An gate after damping therefore gives , while damping after relaxes part of that population back to .
Use the implemented circuit and its timing: routing adds gates, idles expose qubits to relaxation, and simultaneous operations may introduce crosstalk. During a finite pulse, Hamiltonian and dissipative evolution generally act together. A fitted channel after each gate can be a useful phenomenological model; it need not equal the microscopic simultaneous evolution. Common noise models explains parameter conventions and their physical limits.
Density matrices and Kraus operators
Section titled “Density matrices and Kraus operators”For a trace-preserving channel,
This averages every branch directly. An -qubit density matrix contains complex entries, compared with for a pure state vector. It gives expectations without trajectory sampling error, although model parameters, floating-point arithmetic, and any numerical integration remain sources of uncertainty or error. Apply small local Kraus operators directly to the density array when possible.
With column-stacking vectorization,
Thus the channel matrix is
It acts on , but contains entries for Hilbert-space dimension . Constructing it explicitly can be far more expensive than applying the Kraus terms. Complex conjugation and vectorization order matter: an incorrect convention can preserve every array dimension while changing the physics.
Simulating a pure-state trajectory
Section titled “Simulating a pure-state trajectory”For a normalized input , calculate
Draw a branch with these probabilities and, only for , set
The branch probabilities generally depend on the current state. For amplitude damping of strength , a jump from occurs with probability , not simply . The no-jump branch also changes the relative amplitudes.
The weighted branch projectors satisfy
Repeating this sampling through a memoryless circuit therefore reproduces its density evolution on average. One trajectory stores only a state vector, but many trajectories may be needed. A mixed initial state must also be sampled from a correctly weighted pure-state ensemble or represented by a purification; choosing one eigenvector discards part of the preparation.
The Monte Carlo wave-function methods of Dalibard, Castin, and Mølmer, reviewed by Plenio and Knight, provide the continuous-time counterpart of this idea. Johansson, Nation, and Nori describe numerical implementations in QuTiP; the current Monte Carlo guide also discusses mixed-state initial ensembles and trajectory averages.
What is sampled: branches or measurement outcomes?
Section titled “What is sampled: branches or measurement outcomes?”Suppose the desired answer is . A trajectory can contribute its conditional expectation . There is no need to draw an additional terminal measurement outcome merely to estimate this mean. For independent, identically distributed trajectories at fixed model parameters,
If instead the goal is a realistic measurement record, sample the final outcome as well. Its variance includes quantum measurement noise. By the law of total variance, averaging conditional expectations removes that extra conditional sampling variance. A fixed- standard-error formula also needs qualification when stopping adaptively or when trajectories share a random context.
Equivalent channels can have different trajectory variance
Section titled “Equivalent channels can have different trajectory variance”Complete dephasing can be written in either form
where . Starting from , the first representation produces and with equal probabilities. Their conditional expectations are and , so the estimator variance is one.
The second representation produces and . Each has conditional expectation zero, so this estimator has zero variance. Both averaged states are . An actual terminal measurement nevertheless has outcomes with equal probabilities in both descriptions. Changing numerical trajectories cannot remove physical measurement randomness.
If the branches describe a monitored environment, their meaning is fixed by that monitoring scheme. If they are only a computational representation, a different unraveling can improve efficiency without changing the averaged channel.
Measurement records and feedback
Section titled “Measurement records and feedback”For a terminal measurement with effects and a classical assignment response ,
This model assumes that the effects and response describe the relevant states and context. Readout can depend on leaked levels, neighbors, or past operations. Backaction after a truly terminal measurement need not be modeled when only its outcome statistics are requested.
Mid-circuit measurements are different: their quantum instruments determine the state used by later gates. If is the underlying instrument and only the noisy reported value is available, the reported branch is
Its trace is the probability of , and division by that trace gives the conditional state. Feedforward must use . Sampling and then is an equivalent trajectory implementation when these latent branches are part of the chosen model; using to control a gate that sees only would give the simulated controller information the experiment lacks.
Reset may be a replacement channel, dissipative preparation, or measurement and feedback; these have different errors and timing. SPAM errors develops preparation and measurement models, and mid-circuit measurement explains the quantum–classical control sequence.
Continuous-time evolution and physical numerical steps
Section titled “Continuous-time evolution and physical numerical steps”A time-local Lindblad model with nonnegative rates has generator
Here is dimensionless and has units of inverse time; alternatively absorb into the jump operator, but do not include the rate twice. Lindblad and Gorini, Kossakowski, and Sudarshan established the semigroup generators. Breuer and Petruccione discuss the physical approximations behind these descriptions. A time-local equation by itself does not establish memorylessness; see Markovian and non-Markovian noise.
For quantum jumps, the unnormalized no-jump state evolves with
Over a short interval, the jump probability is . Small-step schemes must control multiple-jump errors; waiting-time methods use the survival norm to locate the next event.
Density ODE solvers and exponential-action methods offer another route. An accurate ODE method need not preserve positivity at a finite step. Conversely, a composition of exact Hamiltonian and dissipative substeps can be completely positive while still having splitting error because the generators do not commute. Refine time steps and compare the actual observable, not just trace and Hermiticity. Solving Lindblad equations and quantum-jump simulation give the detailed algorithms.
Correlations must persist across the right time interval
Section titled “Correlations must persist across the right time interval”Consider repeated phase rotations of an initial . Let each individual offset have zero-mean Gaussian distribution with variance . Two models with the same single-step channel give different repeated evolution:
Here . In the quasistatic model, one offset is drawn per run and the accumulated phase is . With independent offsets, the phase is a sum with variance . Averaging its complex phase gives these Gaussian characteristic functions.
The same single-step noise does not determine a whole sequence. For radians per rotation, a persistent offset gives , whereas independent offsets give . The curves are calculated from the displayed models.
For even , an ideal sign reversal halfway through cancels the quasistatic phase exactly. Independently drawn offsets still have total variance . Echo is therefore a useful test of the correlation assumption, not just another gate-count measurement. Draw one offset per correlation block, or a full path from the specified stochastic process; drawing fresh noise at every gate silently changes the model.
An environment that is kept or reset
Section titled “An environment that is kept or reset”An explicit system–environment calculation retains their joint state. Tracing out the environment at the end is harmless for system observables; discarding it and replacing it during the calculation generally destroys correlations that affect later evolution. Fresh independent ancillas give a memoryless collision construction. Reusing a correlated ancilla can give revivals that repeated copies of the one-step reduced channel cannot reproduce.
A process tensor describes how a sequence of interventions affects later outcomes, including temporal correlations. Pollock and colleagues develop this multitime description. Compressing an influence functional or a process tensor along time can help when its structure permits; a short two-point bath correlation alone does not guarantee a small temporal bond or justify every memory cutoff. Vary the cutoff, time resolution, and temporal bond and check the requested output.
Methods for larger or structured systems
Section titled “Methods for larger or structured systems”| Structure | Useful representation | Main limitation |
|---|---|---|
| Small general system | Density matrix | storage |
| A few means, moderate width | Pure-state trajectories | State size and variance |
| Stabilizer inputs, Clifford gates, Pauli faults | Tableau or Pauli frames | Restricted dynamics |
| Modest spatial correlations | MPO or purified tensors | Bond growth |
| Classical drift | State plus latent process | Correct correlation law |
| Quantum memory | Joint environment or process tensor | Environment or temporal size |
A Pauli simulator is exact for its stated stochastic Pauli model, but twirling a coherent error changes that model. Equal one-gate average infidelity need not give equal long-sequence behavior; see stabilizer simulation.
An MPO compresses operator-space correlations rather than pure-state entanglement alone. Truncating it can break positivity. A factorization preserves positivity of the represented state even when is compressed, as in the locally purified approach of Werner and colleagues. It still needs trace normalization and convergence in spatial and purification dimensions. Positivity of one approximate output does not prove that the numerical procedure implements a linear completely positive channel on every input.
Explicit leakage requires extra levels, their gates, readout response, and return paths. With local -level systems, density storage is . A classical leakage flag is a useful approximation only when the discarded coherences and return dynamics are irrelevant to the calculation. Leakage and crosstalk explains that physical choice. Postselected results must include their acceptance probability; a normalized accepted state does not describe rejected runs.
Parameter uncertainty and numerical uncertainty
Section titled “Parameter uncertainty and numerical uncertainty”Let denote uncertain model parameters and a trajectory estimator. Write . Then
This distinguishes variation of the predicted mean across parameter values from randomness at fixed parameters. A posterior or a defined bootstrap distribution supplies weights for parameter averaging. A confidence region alone supplies a set of possibilities, not a unique probability distribution over them; scanning that region is a sensitivity analysis.
If independent parameter draws each receive independent inner trajectories, the variance of the equally weighted nested mean is
Increasing alone cannot remove the first term. Increasing improves the numerical estimate of a chosen parameter average; it does not make the underlying calibration uncertainty vanish. For an unknown parameter fixed through a device run, keep it fixed within that simulated run. Resampling it at every gate would model physical fluctuations instead.
Common random numbers can improve differences between models, but the error bar must use the paired differences, including their covariance. Track discretization, tensor truncation, numerical precision, parameter uncertainty, and trajectory uncertainty separately. More trajectories cannot repair a wrong correlation model.
Compare small instances using density evolution and trajectory averages with uncertainty. Test trace, Hermiticity, positivity, limiting channels, and complex matrix conventions. Compare predictions with circuits and operating contexts not used to fit the parameters. If halving a time step shifts a result, compare that shift with its sampling uncertainty and repeat the refinement; one small change after doubling trajectory count does not prove that sampling error is negligible. Clipping negative density eigenvalues changes the answer and must not substitute for finding the numerical problem.
Exercises
Section titled “Exercises”1. Estimate density-matrix memory
Section titled “1. Estimate density-matrix memory”How much raw memory does a complex128 density matrix require for qubits, before scratch space and alignment?
Solution
The matrix contains
complex entries. At 16 bytes per complex128 value, this is
A practical update may need the input, output, Kraus workspaces, and temporary permutations simultaneously, so 16 GiB is not a sufficient machine-memory budget.
2. Sample amplitude damping
Section titled “2. Sample amplitude damping”For amplitude damping with
find the trajectory probabilities for .
Solution
The jump probability is
The no-jump probability is
For a nonzero-probability jump, the state is physically . On no jump, it is
Averaging the two branch projectors gives the usual amplitude-damping channel.
3. Show that placement matters
Section titled “3. Show that placement matters”Start in . Compare an ideal gate followed by amplitude damping of strength with amplitude damping followed by .
Solution
Applying first prepares . Damping then gives
Damping does nothing, and the later gives
Thus for . A channel name and probability do not define a circuit model without composition order.
4. Estimate trajectory uncertainty
Section titled “4. Estimate trajectory uncertainty”A binary logical-failure estimator observes failures in independent trajectories. Estimate the rate and its standard error using the binomial plug-in variance.
Solution
The estimate is
The estimated standard error is
A report should use an appropriate binomial interval rather than treating as exact in every regime.
5. Apply a readout response
Section titled “5. Apply a readout response”An ideal measurement gives . The readout flips with probability and with probability . Find the reported probability .
Solution
Using the classical response,
Since ,
This postprocessing is valid only under the declared factorization between quantum evolution and classical readout confusion.
6. Compare persistent and independent offsets
Section titled “6. Compare persistent and independent offsets”For ten phase rotations with radians, calculate in the two Gaussian models above. What does an ideal sign reversal after the fifth rotation change?
Solution
The persistent phase has variance , so . Independent increments have variance , so . The sign reversal changes the persistent sum to , giving coherence one in this ideal model. In the independent model, changing signs does not change the variance of the sum, so its coherence remains .
7. A trace-preserving step that is not positive
Section titled “7. A trace-preserving step that is not positive”Evolve under . One forward-Euler step gives . Find its eigenvalues and explain why trace and Hermiticity checks are insufficient.
Solution
Using and gives
Its eigenvalues are
The smaller eigenvalue is negative for every nonzero step, although the matrix is Hermitian and trace one. The exact unitary update rotates the Bloch vector on the unit sphere; Euler moves along a tangent outside it. Decreasing the step decreases the violation but does not make this finite-step map positive. Unitary exponentiation preserves positivity for this example.
8. Reduce estimator variance without changing the channel
Section titled “8. Reduce estimator variance without changing the channel”Apply complete dephasing to using either Kraus set or . Compare the variance of the conditional expectation with the variance of a sampled terminal outcome. Do the two Kraus sets describe the same monitored record?
Solution
For the first set, the states are , so conditional expectations are and their variance is one. For the second, the states are , so both conditional expectations are zero and their variance vanishes. Both output densities are .
Terminal outcomes have mean zero and variance one in either case. In the second representation that variance comes entirely from the final measurement. The two Kraus sets are equivalent for unmonitored system evolution, but their branch labels correspond to different environment monitoring schemes.
9. Allocate nested samples
Section titled “9. Allocate nested samples”A parameter distribution assigns equal weights to failure probabilities and . For each of independent parameter draws, simulate independent Bernoulli outcomes. Find the mean and variance of the overall estimated rate. What remains if only tends to infinity?
Solution
The parameter-averaged mean is . Across parameter draws, , and the average conditional variance is
Consequently,
At fixed , increasing only leaves . Increasing improves Monte Carlo integration over the assumed parameter distribution; its physical spread has not disappeared.
10. Keep the environment’s memory
Section titled “10. Keep the environment’s memory”A system starts in and an environment qubit in . Apply CNOT with the system as control twice. Compare the final system state if the environment is retained with the result if it is discarded and replaced by between gates.
Solution
The first CNOT creates a Bell pair, so the reduced system state is . Keeping the environment lets the second CNOT undo the first, restoring . Thus the system ends pure with .
Resetting the environment removes the Bell correlations and leaves . The second CNOT then leaves the reduced system , with . A reduced state at one time does not encode the correlations needed for later memory effects.
References
Section titled “References”- H.-P. Breuer and F. Petruccione, The Theory of Open Quantum Systems, Oxford University Press (2002), doi:10.1093/acprof:oso/9780199213900.001.0001.
- J. Dalibard, Y. Castin, and K. Mølmer, “Wave-function approach to dissipative processes in quantum optics,” Physical Review Letters 68, 580–583 (1992), doi:10.1103/PhysRevLett.68.580.
- V. Gorini, A. Kossakowski, and E. C. G. Sudarshan, “Completely positive dynamical semigroups of N-level systems,” Journal of Mathematical Physics 17, 821–825 (1976), doi:10.1063/1.522979.
- J. R. Johansson, P. D. Nation, and F. Nori, “QuTiP 2: A Python framework for the dynamics of open quantum systems,” Computer Physics Communications 184, 1234–1240 (2013), doi:10.1016/j.cpc.2012.11.019.
- G. Lindblad, “On the generators of quantum dynamical semigroups,” Communications in Mathematical Physics 48, 119–130 (1976), doi:10.1007/BF01608499.
- M. B. Plenio and P. L. Knight, “The quantum-jump approach to dissipative dynamics in quantum optics,” Reviews of Modern Physics 70, 101–144 (1998), doi:10.1103/RevModPhys.70.101.
- F. A. Pollock et al., “Non-Markovian quantum processes: Complete framework and efficient characterization,” Physical Review A 97, 012127 (2018), doi:10.1103/PhysRevA.97.012127.
- A. H. Werner et al., “Positive tensor network approach for simulating open quantum many-body systems,” Physical Review Letters 116, 237201 (2016), doi:10.1103/PhysRevLett.116.237201.