Stim’s circuit noise model is restricted to Pauli channels — probabilistic applications of tensor products ofDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/quantumlib/Stim/llms.txt
Use this file to discover all available pages before exploring further.
{I, X, Y, Z} operators. This covers the noise models most relevant to fault-tolerance thresholds and is sufficient to model physical hardware at the level of abstraction used by most QEC researchers. Non-Pauli noise (such as amplitude damping or coherent errors) cannot be expressed directly in a .stim circuit file, but can be simulated manually using stim.TableauSimulator.
Noise instructions are valid circuit instructions like any gate. During ideal simulation — for example, when calling circuit.to_tableau() or circuit.without_noise() — all noise channels are silently ignored. When sampling with circuit.compile_sampler() or circuit.compile_detector_sampler(), noise fires stochastically.
Single-qubit Pauli flips
These channels apply a fixed Pauli operator with a given probability to each targeted qubit independently.- X_ERROR
- Y_ERROR
- Z_ERROR
Applies a Pauli X (bit flip) with probability Pauli mixture:
p:(1-p) I + p XDepolarizing channels
DEPOLARIZE1(p)
Single-qubit depolarizing channel. Applies a uniformly random non-identity Pauli (Pauli mixture:
X, Y, or Z) each with probability p/3. Maximal mixing occurs at p=0.75.(1-p) I + (p/3) X + (p/3) Y + (p/3) ZDEPOLARIZE2(p)
Two-qubit depolarizing channel. Applies a uniformly random non-identity Pauli pair from the 15 non-Pauli mixture:
II elements of {I,X,Y,Z}⊗{I,X,Y,Z}, each with probability p/15. Maximal mixing occurs at p=0.9375.(1-p) II + (p/15)(IX + IY + IZ + XI + XX + XY + XZ + YI + YX + YY + YZ + ZI + ZX + ZY + ZZ)DEPOLARIZE2 is the most common noise model for two-qubit gates in superconducting qubit systems. After every CX or CZ in an annotated circuit, you will typically see DEPOLARIZE2(p) control target.Custom Pauli channels
PAULI_CHANNEL_1(px, py, pz)
A single-qubit Pauli channel with individually specified error probabilities. The three arguments are disjoint, so their sum must not exceed 1. The no-error probability is1 - px - py - pz.
px = py = 0 and only pz > 0).
Correlated errors
CORRELATED_ERROR (also written as E) and ELSE_CORRELATED_ERROR model error mechanisms that simultaneously affect multiple qubits, or that arise from a single underlying fault in hardware.
CORRELATED_ERROR(p) / ELSE_CORRELATED_ERROR(p)
CORRELATED_ERROR fires with probability p and sets an internal “correlated error occurred” flag. Subsequent ELSE_CORRELATED_ERROR instructions fire with their stated probability only if no earlier error in the group has fired yet. Together they represent a single fault that can manifest in different ways.
X, Y, Z) and are all implicitly combined (no explicit * combiner needed, for backward compatibility).
Heralded erasure
HERALDED_ERASE(p)
The heralded erasure channel records a measurement bit indicating whether or not an erasure occurred. When it fires (probabilityp), the qubit is erased to the maximally mixed state (via X_ERROR(0.5) and Z_ERROR(0.5)). When it does not fire (probability 1-p), a 0 is recorded and the qubit is untouched.
| Probability | Herald bit | Effect |
|---|---|---|
1-p | 0 | I |
p/4 | 1 | I |
p/4 | 1 | X |
p/4 | 1 | Y |
p/4 | 1 | Z |
Limitations and non-Pauli noise
Why only Pauli noise in circuits?
Why only Pauli noise in circuits?
Pauli channels are the natural noise model for the stabilizer formalism. They keep the simulation state in the stabilizer representation and allow efficient bulk sampling via the Clifford frame simulation algorithm. Non-Pauli channels (such as amplitude damping, depolarizing with coherent rotations, or leakage) cannot be represented exactly within this framework.
Simulating non-Pauli noise with TableauSimulator
Simulating non-Pauli noise with TableauSimulator
If you need to model amplitude damping or other non-Pauli channels, you can use
stim.TableauSimulator and manually implement the channel by sampling which Kraus operator was applied (based on the channel’s probabilities) and then calling the corresponding Pauli method (x_error, z_error, etc.) on the simulator. This is more flexible but cannot produce the fast bulk samples that the compiled samplers can.Noise is ignored during ideal simulation
Noise is ignored during ideal simulation
Methods that analyze the circuit without stochastic sampling — such as
circuit.to_tableau(), circuit.without_noise(), and the noiseless reference pass used to determine detector parities — all ignore every noise instruction. Only the compiled samplers (compile_sampler(), compile_detector_sampler()) actually fire noise during execution.Choosing the right noise channel
| Scenario | Recommended channel |
|---|---|
| Single-qubit gate errors (symmetric) | DEPOLARIZE1(p) |
| Two-qubit gate errors (symmetric) | DEPOLARIZE2(p) |
| Measurement readout error | X_ERROR(p) before M |
| Reset error | X_ERROR(p) after R |
| Biased (dephasing-only) noise | Z_ERROR(p) or PAULI_CHANNEL_1(0, 0, p) |
| Hardware-specific correlated faults | CORRELATED_ERROR / ELSE_CORRELATED_ERROR |
| Erasure-based hardware (e.g., neutral atoms) | HERALDED_ERASE(p) |