Skip to content

Allow for constant Result arrays in Adaptive Profile - #3389

Open
Stefan J. Wernli (swernli) wants to merge 7 commits into
mainfrom
swernli/constant-result-arrays
Open

Allow for constant Result arrays in Adaptive Profile#3389
Stefan J. Wernli (swernli) wants to merge 7 commits into
mainfrom
swernli/constant-result-arrays

Conversation

@swernli

@swernli Stefan J. Wernli (swernli) commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This change updates the data types in RIR to allow for variables of type Result to be used in the Adaptive Profile. This makes it possible to emit constant arrays of result identifiers into the data section of the generated QIR the same way arrays of qubit identifiers are supported.
This also updates how Result literals are handled, allowing for their emission into RIR by transforming Zero and One into a extra result ids during QIR codegen that are initialized via a proposed __quantum__rt__write_result API (see qir-alliance/qir-spec#65).

This change updates the data types in RIR to allow for variables of type Result to be used in the Adaptive Profile. This makes it possible to emit constant arrays of result identifiers into the data section of the generated QIR the same way arrays of qubit identifiers are supported.
This also updates how Result literals are handled, allowing for their emission into RIR by transforming `Zero` and `One` into a extra result ids during QIR codegen that are initialized via a proposed `__quantum__rt__write_result` API (see qir-alliance/qir-spec#65).
@swernli
Stefan J. Wernli (swernli) force-pushed the swernli/constant-result-arrays branch from 594458c to ba1ae5f Compare July 23, 2026 21:22
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