Skip to content

Support write_result operation in adaptive simulators - #3671

Open
João Boechat (joao-boechat) wants to merge 1 commit into
joaoboechat/stim-improve-error-messagesfrom
joaoboechat/implement-op-write-result
Open

Support write_result operation in adaptive simulators#3671
João Boechat (joao-boechat) wants to merge 1 commit into
joaoboechat/stim-improve-error-messagesfrom
joaoboechat/implement-op-write-result

Conversation

@joao-boechat

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

Copy link
Copy Markdown
Contributor

Adds adaptive simulator support for void @__quantum__rt__write_result(i1, ptr), following the design proposed in qir-alliance/qir-spec#65. The operation initializes or overwrites a result identifier with a Boolean value that subsequent reads and output recording observe.

This implementation will be used in a follow-up PR for the STIM compiler, in order to support certain operations that involve writing arbitrary boolean values to measurement records.

Implementation

  • Adds Python, Rust, and GPU bytecode handling for the intrinsic, including dynamically computed Boolean values.
  • Implements result writes for the CPU full-state, Clifford, and GPU adaptive simulators.

Tests

Adds CPU, Clifford, and GPU coverage for constant writes, overwrites, and dynamically computed Boolean values.

@joao-boechat
João Boechat (joao-boechat) changed the base branch from main to joaoboechat/finalize-non-clifford-support August 31, 2026 22:58
@joao-boechat
João Boechat (joao-boechat) changed the base branch from joaoboechat/finalize-non-clifford-support to joaoboechat/stim-improve-error-messages August 31, 2026 22:59
@joao-boechat
João Boechat (joao-boechat) marked this pull request as ready for review August 31, 2026 23:11
@joao-boechat
João Boechat (joao-boechat) force-pushed the joaoboechat/implement-op-write-result branch from c7d8b34 to cdf7def Compare September 2, 2026 19:35
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