Skip to content

Support readout noise in simulators and stim compiler - #3581

Open
João Boechat (joao-boechat) wants to merge 10 commits into
mainfrom
joaoboechat/support-readout-noise
Open

Support readout noise in simulators and stim compiler#3581
João Boechat (joao-boechat) wants to merge 10 commits into
mainfrom
joaoboechat/support-readout-noise

Conversation

@joao-boechat

@joao-boechat João Boechat (joao-boechat) commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds end-to-end support for readout noise (classical bit-flip noise applied
to a measurement result after it is sampled). A measured 0 can be reported
as 1 with probability p_zero_as_one, and a measured 1 as 0 with
probability p_one_as_zero. The feature spans the Stim compiler, the QIR/adaptive
runtime representation, and every simulator back end.

Stim compiler

  • Measurement instructions (M/MZ/MX/MY, MR/MRZ/MRX/MRY, and the
    pair measurements MXX/MYY/MZZ) now accept an optional parenthesized
    probability, e.g. M(0.1) 0, and emit a __quantum__rt__readout_noise call
    per produced result. Previously a parenthesized argument was rejected.
  • Probability is validated (0 <= p <= 1, at most one argument); a probability
    of 0 emits no noise call.
  • Introduced ResultId / QubitId / StimQubitId type aliases to make the
    qubit-vs-result index distinction explicit throughout the QIR writer.

Runtime / QIR representation

  • New runtime intrinsic:
    __quantum__rt__readout_noise(double p_zero_as_one, double p_one_as_zero, ptr result).
  • New adaptive-bytecode opcode (OP_READOUT_NOISE) and a new
    QirInstruction::ReadoutNoise / QirInstructionId::ReadoutNoise.
  • The Python adaptive-profile pass and the aggregate-gates pass lower the
    intrinsic into the new instruction/opcode.

Simulators

Readout noise is supported in all simulators, base profile and adaptive profile:

  • CPU full-state simulator
  • CPU stabilizer (Clifford) simulator
  • GPU full-state simulator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant